
/*
========================================================
TIM TARIF – TARIFKOSTENRECHNER
Datei: /tarifrechner/tarifrechner.css

Eigenständige Gestaltung für:
- Tarifrechner-Aufruf auf der Startseite
- Modales Pop-up
- Strom- und Gasberechnung
- Preisvergleich und Ergebnisanzeige
- Mobile Darstellung

Alle Selektoren sind auf den Tarifrechner begrenzt.
========================================================
*/


/* =====================================================
   1. EIGENE FARBEN UND GRUNDEINSTELLUNGEN
===================================================== */

.tt-rechner-teaser,
.tt-rechner-dialog {
    --tt-r-ink: #24323d;
    --tt-r-muted: #64717d;
    --tt-r-accent: #16796f;
    --tt-r-accent-hover: #10655d;
    --tt-r-accent-light: #eaf5f2;
    --tt-r-surface: #ffffff;
    --tt-r-soft: #f5f7f8;
    --tt-r-border: #dce4e8;
    --tt-r-success: #16745b;
    --tt-r-warning: #a94c38;

    color: var(--tt-r-ink);
}

.tt-rechner-teaser,
.tt-rechner-teaser *,
.tt-rechner-dialog,
.tt-rechner-dialog * {
    box-sizing: border-box;
}


/* =====================================================
   2. TARIFRECHNER-AUFRUF UNTER DEN TARIFKACHELN
===================================================== */

.tt-rechner-teaser {
    display: flex;
    flex-direction: column;
    align-items: center;

    width: 100%;
    max-width: 680px;

    margin: 22px auto 0;
    padding: 22px 24px;

    background: var(--tt-r-soft);
    border: 1px solid var(--tt-r-border);
    border-radius: 18px;

    text-align: center;
}

.tariff-selector .tt-rechner-teaser h2 {
    margin: 0 0 9px;
    padding: 0;

    font-size: clamp(18px, 2.4vw, 22px);
    font-weight: 700;
    line-height: 1.3;

    color: var(--tt-r-ink);
}

.tt-rechner-teaser p {
    max-width: 560px;

    margin: 0 0 17px;
    padding: 0;

    font-size: 14px;
    line-height: 1.6;

    color: var(--tt-r-muted);
}

.tt-rechner-teaser-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    min-height: 44px;
    padding: 11px 22px;

    background: var(--tt-r-accent);
    border: 1px solid var(--tt-r-accent);
    border-radius: 11px;

    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.tt-rechner-teaser-button:hover {
    background: var(--tt-r-accent-hover);
    border-color: var(--tt-r-accent-hover);
    transform: translateY(-1px);
}

.tt-rechner-teaser-button span {
    font-size: 18px;
    line-height: 1;
}

.tt-rechner-teaser-button:focus-visible {
    outline: 3px solid var(--tt-r-accent);
    outline-offset: 3px;
}


/* =====================================================
   3. POP-UP-FENSTER / DIALOG
===================================================== */

.tt-rechner-dialog {
    position: fixed;
    inset: 0;

    width: min(640px, calc(100% - 24px));
    max-width: 640px;

    max-height: 88vh;
    max-height: 88dvh;

    margin: auto;
    padding: 0;

    background: var(--tt-r-surface);
    border: 1px solid var(--tt-r-border);
    border-radius: 20px;

    box-shadow:
        0 24px 75px rgba(15, 30, 45, 0.24);

    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;

    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;

    color: var(--tt-r-ink);
}

.tt-rechner-dialog:not([open]) {
    display: none !important;
}

.tt-rechner-dialog[open] {
    display: block;
    animation: tt-rechner-appear 0.22s ease-out;
}

.tt-rechner-dialog::backdrop {
    background: rgba(15, 25, 35, 0.64);
    backdrop-filter: blur(3px);
}

@keyframes tt-rechner-appear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =====================================================
   4. INHALTSBEREICH DES POP-UPS
===================================================== */

.tt-rechner {
    padding: 22px 25px 23px;
}

.tt-rechner-dialog [hidden] {
    display: none !important;
}


/* =====================================================
   5. KOPFZEILE MIT TIM-SIGNET
===================================================== */

.tt-rechner-header {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin-bottom: 12px;
    padding-bottom: 13px;

    border-bottom: 1px solid var(--tt-r-border);
}

.tt-rechner-brand {
    display: flex;
    align-items: center;
    gap: 12px;

    min-width: 0;
}

.tt-rechner-mascot {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 48px;

    width: 48px;
    height: 48px;

    background: transparent;;
    border: none;
    border-radius: 50%;

    overflow: hidden;

    /*
    PLATZHALTER FÜR TIMS KOPF

    Später kann hier ein freigestelltes Bild
    per HTML oder background-image erscheinen.

    Beispiel:

    background-image: url("/assets/img/tim-kopf.png");
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    */
    background-image: url("/assets/img/TimTarif_logo_kopf_signett.png");
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
}

.tt-rechner-mascot img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;
}

.tt-rechner-heading {
    min-width: 0;
}

.tt-rechner-brand-name {
    display: block;

    margin-bottom: 1px;

    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;

    color: var(--tt-r-ink);
}

.tt-rechner-heading h2 {
    margin: 0;
    padding: 0;

    font-size: 20px;
    font-weight: 750;
    line-height: 1.25;

    color: var(--tt-r-accent);
}


/* =====================================================
   6. SCHLIESSEN-BUTTON
===================================================== */

.tt-rechner-close {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 35px;

    width: 35px;
    height: 35px;

    padding: 0;

    background: var(--tt-r-soft);
    border: 1px solid var(--tt-r-border);
    border-radius: 10px;

    font-family: inherit;
    font-size: 26px;
    font-weight: 400;
    line-height: 1;

    color: var(--tt-r-muted);
    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.tt-rechner-close:hover {
    background: #e9eef0;
    color: var(--tt-r-ink);
}


/* =====================================================
   7. BESCHREIBUNG
===================================================== */

.tt-rechner-description {
    margin: 0 0 17px;
    padding: 0;

    font-size: 13px;
    line-height: 1.6;

    color: var(--tt-r-muted);
}


/* =====================================================
   8. ABSCHNITTE UND ÜBERSCHRIFTEN
===================================================== */

.tt-rechner-section {
    margin-top: 15px;
    padding: 15px;

    background: var(--tt-r-soft);
    border: 1px solid var(--tt-r-border);
    border-radius: 13px;
}

.tt-rechner-section h3 {
    margin: 0 0 12px;
    padding: 0;

    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;

    color: var(--tt-r-ink);
}

.tt-rechner-section-description {
    margin: -5px 0 13px;
    padding: 0;

    font-size: 12px;
    line-height: 1.5;

    color: var(--tt-r-muted);
}


/* =====================================================
   9. EINGABEFELDER
===================================================== */

.tt-rechner-field {
    min-width: 0;
}

.tt-rechner-field + .tt-rechner-field {
    margin-top: 12px;
}

.tt-rechner-field label {
    display: block;

    margin: 0 0 6px;
    padding: 0;

    font-size: 12px;
    font-weight: 650;
    line-height: 1.45;

    color: var(--tt-r-ink);
}

.tt-rechner-dialog input[type="number"],
.tt-rechner-dialog select {
    display: block;

    width: 100%;
    min-width: 0;
    height: 41px;

    margin: 0;
    padding: 9px 11px;

    background: #ffffff;
    border: 1px solid #cdd8dd;
    border-radius: 9px;

    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;

    color: var(--tt-r-ink);

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.tt-rechner-dialog select {
    cursor: pointer;
    padding-right: 30px;
}

.tt-rechner-dialog input[type="number"]:focus,
.tt-rechner-dialog select:focus {
    outline: none;

    border-color: var(--tt-r-accent);

    box-shadow:
        0 0 0 3px rgba(22, 121, 111, 0.13);
}

.tt-rechner-dialog input[aria-invalid="true"] {
    border-color: var(--tt-r-warning);
    background: #fffafa;
}

.tt-rechner-dialog input::placeholder {
    font-size: 12px;
    font-weight: 400;

    color: #94a0a9;
}


/* =====================================================
   10. EINGABEFELD MIT EINHEIT
===================================================== */

.tt-rechner-input-unit {
    position: relative;
}

.tt-rechner-input-unit input {
    padding-right: 67px !important;
}

.tt-rechner-unit {
    position: absolute;
    top: 50%;
    right: 12px;

    transform: translateY(-50%);

    font-size: 12px;
    font-weight: 650;

    color: var(--tt-r-muted);

    pointer-events: none;
}


/* =====================================================
   11. ZWEISPALTIGE EINGABEFELDER
===================================================== */

.tt-rechner-fields-grid {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.tt-rechner-fields-grid .tt-rechner-field {
    min-width: 0;
    margin-top: 0;
}


/* =====================================================
   12. ZUSÄTZLICHE GASFELDER
===================================================== */

.tt-rechner-gas-options {
    margin-top: 12px;
    padding-top: 12px;

    border-top: 1px solid var(--tt-r-border);
}

.tt-rechner-gas-conversion {
    margin-top: 12px;
    padding: 12px;

    background: #ffffff;
    border: 1px solid var(--tt-r-border);
    border-radius: 10px;
}

.tt-rechner-gas-conversion .tt-rechner-field + .tt-rechner-field {
    margin-top: 10px;
}

.tt-rechner-hint {
    margin: 10px 0 0;

    font-size: 11px;
    line-height: 1.55;

    color: var(--tt-r-muted);
}

.tt-rechner-converted {
    margin: 9px 0 0;
    padding: 9px 11px;

    background: var(--tt-r-accent-light);
    border-radius: 8px;

    font-size: 12px;
    font-weight: 650;

    color: var(--tt-r-accent);
}


/* =====================================================
   13. EINGABEPRÜFUNG
===================================================== */

.tt-rechner-validation {
    margin: 12px 0 0;
    padding: 10px 12px;

    background: #fff4f0;
    border: 1px solid #efd1c8;
    border-radius: 9px;

    font-size: 12px;
    line-height: 1.5;

    color: #93422f;
}


/* =====================================================
   14. ERGEBNIS AKTUELLER TARIF
===================================================== */

.tt-rechner-result {
    margin-top: 15px;
    padding: 15px;

    background: #ffffff;
    border: 1px solid var(--tt-r-border);
    border-radius: 13px;
}

.tt-rechner-result h3 {
    margin: 0 0 12px;

    font-size: 15px;
    font-weight: 700;

    color: var(--tt-r-ink);
}

.tt-rechner-result-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;

    margin: 0;
    padding: 6px 0;

    font-size: 12px;
    line-height: 1.5;

    color: var(--tt-r-muted);
}

.tt-rechner-result-row output {
    flex-shrink: 0;

    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;

    color: var(--tt-r-ink);
}

.tt-rechner-result-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin: 10px 0 5px;
    padding: 12px 0;

    border-top: 1px solid var(--tt-r-border);
    border-bottom: 1px solid var(--tt-r-border);

    font-size: 13px;
    font-weight: 700;

    color: var(--tt-r-ink);
}

.tt-rechner-result-total output {
    flex-shrink: 0;

    font-size: 21px;
    font-weight: 750;
    white-space: nowrap;

    color: var(--tt-r-accent);
}


/* =====================================================
   15. EINSPARERGEBNIS
===================================================== */

.tt-rechner-savings {
    margin-top: 15px;
    padding: 15px;

    background: #ffffff;
    border: 1px solid var(--tt-r-border);
    border-radius: 13px;
}

.tt-rechner-savings h3 {
    margin: 0 0 10px;

    font-size: 15px;
    font-weight: 700;

    color: var(--tt-r-ink);
}

.tt-rechner-savings-highlight {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin-top: 11px;
    padding: 13px;

    background: var(--tt-r-accent-light);
    border-radius: 10px;

    color: var(--tt-r-success);
}

.tt-rechner-savings-highlight span {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.tt-rechner-savings-highlight output {
    flex-shrink: 0;

    font-size: 23px;
    font-weight: 750;
    white-space: nowrap;
}

.tt-rechner-savings-monthly {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;

    margin: 10px 0 0;
    padding: 0;

    font-size: 12px;
    line-height: 1.5;

    color: var(--tt-r-muted);
}

.tt-rechner-savings-monthly output {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;

    color: var(--tt-r-ink);
}


/* MEHRKOSTEN STATT ERSPARNIS */

.tt-rechner-savings.is-negative
.tt-rechner-savings-highlight {
    background: #fff0ec;
    color: var(--tt-r-warning);
}


/* GLEICHE KOSTEN ODER NOCH KEIN ERGEBNIS */

.tt-rechner-savings.is-neutral
.tt-rechner-savings-highlight {
    background: var(--tt-r-soft);
    color: var(--tt-r-ink);
}


/* =====================================================
   16. WEITERLEITUNGSBUTTON
===================================================== */

.tt-rechner-actions {
    margin-top: 17px;
}

.tt-rechner-dialog .tt-rechner-compare-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    width: 100%;
    min-height: 47px;

    padding: 12px 16px;

    background: var(--tt-r-accent);
    border: 1px solid var(--tt-r-accent);
    border-radius: 11px;

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;

    color: #ffffff;
    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.tt-rechner-dialog .tt-rechner-compare-button:hover {
    background: var(--tt-r-accent-hover);
    border-color: var(--tt-r-accent-hover);

    color: #ffffff;
    text-decoration: none;

    transform: translateY(-1px);
}

.tt-rechner-compare-button span:last-child {
    font-size: 18px;
    line-height: 1;
}


/* =====================================================
   17. RECHTLICHER / RECHNERISCHER HINWEIS
===================================================== */

.tt-rechner-disclaimer {
    margin: 14px 0 0;
    padding: 0;

    font-size: 10.5px;
    line-height: 1.6;

    color: var(--tt-r-muted);
}


/* =====================================================
   18. TASTATURBEDIENUNG
===================================================== */

.tt-rechner-dialog button:focus-visible,
.tt-rechner-dialog a:focus-visible {
    outline: 3px solid var(--tt-r-accent);
    outline-offset: 3px;
}


/* =====================================================
   19. MOBILANSICHT – TABLET
===================================================== */

@media (max-width: 700px) {

    .tt-rechner-teaser {
        max-width: 100%;

        margin-top: 18px;
        padding: 19px 17px;

        border-radius: 15px;
    }

    .tt-rechner-dialog {
        width: calc(100% - 20px);
        max-height: 92vh;
        max-height: 92dvh;

        border-radius: 16px;
    }

    .tt-rechner {
        padding: 17px;
    }

    .tt-rechner-heading h2 {
        font-size: 18px;
    }

}


/* =====================================================
   20. MOBILANSICHT – SMARTPHONE
===================================================== */

@media (max-width: 480px) {

    .tt-rechner-teaser {
        margin-top: 16px;
        padding: 16px 13px;
    }

    .tariff-selector .tt-rechner-teaser h2 {
        font-size: 17px;
    }

    .tt-rechner-teaser p {
        font-size: 12px;
        line-height: 1.55;
    }

    .tt-rechner-teaser-button {
        width: 100%;
        max-width: 270px;

        min-height: 43px;
        padding: 10px 14px;
    }

    .tt-rechner-dialog {
        width: calc(100% - 12px);

        max-height: 96vh;
        max-height: 96dvh;

        border-radius: 15px;
    }

    .tt-rechner {
        padding: 13px;
    }

    .tt-rechner-header {
        gap: 9px;
        margin-bottom: 9px;
        padding-bottom: 10px;
    }

    .tt-rechner-brand {
        gap: 9px;
    }

    .tt-rechner-mascot {
        flex-basis: 40px;

        width: 40px;
        height: 40px;
    }

    .tt-rechner-heading h2 {
        font-size: 17px;
    }

    .tt-rechner-brand-name {
        font-size: 11px;
    }

    .tt-rechner-description {
        margin-bottom: 12px;
        font-size: 12px;
    }

    .tt-rechner-section,
    .tt-rechner-result,
    .tt-rechner-savings {
        margin-top: 11px;
        padding: 12px;

        border-radius: 11px;
    }

    .tt-rechner-fields-grid {
        gap: 9px;
    }

    .tt-rechner-field label {
        font-size: 11px;
    }

    .tt-rechner-dialog input[type="number"],
    .tt-rechner-dialog select {
        height: 40px;
        padding: 8px 9px;
        font-size: 14px;
    }

    .tt-rechner-result-total output {
        font-size: 18px;
    }

    .tt-rechner-savings-highlight {
        padding: 11px;
    }

    .tt-rechner-savings-highlight output {
        font-size: 20px;
    }

    .tt-rechner-result-row,
    .tt-rechner-result-total,
    .tt-rechner-savings-highlight,
    .tt-rechner-savings-monthly {
        flex-wrap: wrap;
    }

}


/* =====================================================
   21. SEHR KLEINE DISPLAYS
===================================================== */

@media (max-width: 350px) {

    .tt-rechner-fields-grid {
        grid-template-columns: 1fr;
    }

    .tt-rechner-fields-grid .tt-rechner-field {
        margin-top: 0;
    }

    .tt-rechner-fields-grid .tt-rechner-field
    + .tt-rechner-field {
        margin-top: 9px;
    }

    .tt-rechner-heading h2 {
        font-size: 16px;
    }

}


/* =====================================================
   22. REDUZIERTE ANIMATIONEN
===================================================== */

@media (prefers-reduced-motion: reduce) {

    .tt-rechner-dialog[open] {
        animation: none;
    }

    .tt-rechner-teaser-button,
    .tt-rechner-close,
    .tt-rechner-compare-button {
        transition: none;
    }

}


/* =====================================================
   ENDE TARIFRECHNER.CSS
===================================================== */
