/* ============================================================================
   Potenzialrechner — Stylesheet
   2-Spalten-Layout, kompakt, mobile-first.
   ============================================================================ */

/* Section --------------------------------------------------------------------*/
.rechner {
    padding: 56px 0 80px;
    background: var(--color-bg, #FAF7F0);
}

/* 2-Spalten-Layout: Form links, iPhone-Bild rechts ---------------------------*/
.rechner-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 64px;
    align-items: start;
    max-width: 1180px;
    margin: 0 auto;
}
.rechner-layout__main { min-width: 0; }
.rechner-layout__visual {
    position: sticky;
    top: 90px;
    text-align: center;
}
.rechner-layout__visual img {
    width: 100%;
    max-width: 280px;
    margin-top: 30px;
    height: auto;
    display: inline-block;
    filter: drop-shadow(0 30px 60px rgba(26, 26, 26, 0.48));
}

/* Header ---------------------------------------------------------------------*/
.rechner-layout__intro {
    margin-bottom: 28px;
}
.rechner-layout__title {
    font-family: Georgia, serif;
    font-size: clamp(28px, 3.4vw, 40px);
    line-height: 1.15;
    margin: 8px 0 14px;
    color: #1A1A1A;
}
.rechner-layout__lead {
    color: #6A6A6A;
    font-size: 16px;
    line-height: 1.55;
    margin: 0;
    max-width: 540px;
}

/* Flash ----------------------------------------------------------------------*/
.rechner-flash {
    margin: 0 0 20px;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid;
    font-size: 14px;
    line-height: 1.5;
}
.rechner-flash--error   { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }
.rechner-flash--success { background: #f0fdf4; color: #166534; border-color: #86efac; }
.rechner-flash--info    { background: #eff6ff; color: #1e40af; border-color: #93c5fd; }

/* Spinner --------------------------------------------------------------------*/
.rechner-spinner {
    background: #FFFFFF;
    border: 1px solid #ECE7DB;
    border-radius: 14px;
    padding: 48px 32px;
    min-height: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 8px 30px rgba(26, 26, 26, 0.04);
}
.rechner-spinner[hidden] { display: none; }
.rechner-spinner__circle {
    width: 64px;
    height: 64px;
    border: 4px solid #F0EBDD;
    border-top-color: #C9A961;
    border-radius: 50%;
    margin: 0 0 24px;
    animation: rechner-spin 1s linear infinite;
}
.rechner-spinner__text {
    margin: 0;
    color: #6A6A6A;
    font-size: 15px;
}
@keyframes rechner-spin {
    to { transform: rotate(360deg); }
}
.rechner--loading .rechner-form,
.rechner--loading .rechner-layout__intro { display: none; }

/* Form-Card ------------------------------------------------------------------*/
.rechner-form {
    background: #FFFFFF;
    border: 1px solid #ECE7DB;
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 8px 30px rgba(26, 26, 26, 0.04);
}

/* Section innerhalb des Forms ------------------------------------------------*/
.rechner-form__section + .rechner-form__section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #F2EEE3;
}
.rechner-form__section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #A8894A;
    margin: 0 0 14px;
}

/* Grid für Eingabefelder -----------------------------------------------------*/
.rechner-form__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
}
.rechner-form__row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.rechner-form__row--full {
    grid-column: 1 / -1;
}

/* Labels ---------------------------------------------------------------------*/
.rechner-form__row label {
    font-size: 12px;
    font-weight: 600;
    color: #6A6A6A;
    letter-spacing: 0.02em;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

/* Inputs ---------------------------------------------------------------------*/
.rechner-form__row input[type="text"],
.rechner-form__row input[type="number"],
.rechner-form__row input[type="email"],
.rechner-form__row input[type="tel"],
.rechner-form__row select {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid #E5E1D8;
    border-radius: 8px;
    font: inherit;
    font-size: 15px;
    color: #1A1A1A;
    background: #FAF7F0;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    appearance: none;
}
.rechner-form__row select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236A6A6A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}
.rechner-form__row input:focus,
.rechner-form__row select:focus {
    outline: none;
    background: #FFFFFF;
    border-color: #C9A961;
    box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.18);
}
.rechner-form__row input::placeholder {
    color: #B8B0A0;
}
.rechner-form__row input.is-invalid,
.rechner-form__row select.is-invalid {
    border-color: #dc2626;
    background: #fef2f2;
}

/* Range-Slider ---------------------------------------------------------------*/
.rechner-form__row--range label {
    margin-bottom: 4px;
    align-items: center;
}
.rechner-form__row--range output {
    background: #1A1A1A;
    color: #FAF7F0;
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13px;
    margin-left: auto;
}
.rechner-form__unit {
    color: #6A6A6A;
    font-weight: 500;
    margin-left: 2px;
}
.rechner-form__row input[type="range"] {
    width: 100%;
    margin: 8px 0 0;
    accent-color: #C9A961;
    height: 6px;
}

/* Checkbox-Reihe (im Modal) --------------------------------------------------*/
.rechner-form__row--checkbox {
    background: #FAF7F0;
    border: 1px solid #ECE7DB;
    padding: 12px 14px;
    border-radius: 8px;
}
.rechner-form__row--checkbox label {
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    line-height: 1.55;
    color: #4A4A4A;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}
.rechner-form__row--checkbox input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: #1A1A1A;
}
.rechner-form__row--checkbox a {
    color: #A8894A;
    text-decoration: underline;
}

/* Errors ---------------------------------------------------------------------*/
.rechner-form__error {
    color: #dc2626;
    font-size: 12px;
    line-height: 1.4;
}

/* Actions --------------------------------------------------------------------*/
.rechner-form__actions {
    margin-top: 24px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.rechner-form__submit {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
}

/* Modal ----------------------------------------------------------------------*/
.rechner-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.rechner-modal[hidden] { display: none; }
.rechner-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(26, 26, 26, 0.7);
    backdrop-filter: blur(4px);
    cursor: pointer;
}
.rechner-modal__panel {
    position: relative;
    background: #FFFFFF;
    border-radius: 14px;
    padding: 32px 28px;
    max-width: 540px;
    width: 100%;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}
.rechner-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #6A6A6A;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.rechner-modal__close:hover {
    background: #FAF7F0;
    color: #1A1A1A;
}
.rechner-modal__panel h2 {
    margin: 0 0 6px;
    font-family: Georgia, serif;
    font-size: 22px;
    color: #1A1A1A;
}
.rechner-modal__intro {
    color: #6A6A6A;
    font-size: 14px;
    margin: 0 0 20px;
    line-height: 1.5;
}

/* Result — eingebettet in .rechner-layout__main, kein eigener Section-Wrapper -*/
.rechner-result__intro {
    margin: 0 0 24px;
}
.rechner-result__title {
    font-family: Georgia, serif;
    font-size: clamp(26px, 3.4vw, 36px);
    line-height: 1.15;
    margin: 8px 0 0;
    color: #1A1A1A;
}
.rechner-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin: 0 0 24px;
}
.rechner-cards--stacked {
    grid-template-columns: 1fr;
}
.rechner-card {
    background: #FFFFFF;
    border: 1px solid #ECE7DB;
    border-radius: 12px;
    padding: 24px 28px;
    text-align: left;
    box-shadow: 0 8px 30px rgba(26, 26, 26, 0.04);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rechner-card--accent {
    background: #1A1A1A;
    color: #FAF7F0;
    border-color: #1A1A1A;
}
.rechner-card__label {
    font-size: 11px;
    color: #6A6A6A;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}
.rechner-card--accent .rechner-card__label { color: #C9A961; }
.rechner-card__value {
    font-family: Georgia, serif;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.1;
    margin: 0;
    color: #1A1A1A;
}
.rechner-card--accent .rechner-card__value { color: #FFFFFF; }
.rechner-card__value--lg { font-size: 40px; }
.rechner-card__growth {
    margin: 0;
    color: #166534;
    font-weight: 600;
    font-size: 13px;
}
.rechner-result__cta {
    margin: 0 0 24px;
}
.rechner-result__cta .btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
}
.rechner-result__disclaimer {
    margin: 0;
    font-size: 11px;
    color: #6A6A6A;
    line-height: 1.5;
    text-align: left;
}

/* Cookie-Consent — siehe main.css (global verfügbar, nicht nur auf Calculator) */

/* Responsive -----------------------------------------------------------------*/
@media (max-width: 980px) {
    .rechner-layout {
        grid-template-columns: 1fr;
        gap: 40px;
        max-width: 640px;
    }
    .rechner-layout__visual {
        position: static;
        order: -1;
    }
    .rechner-layout__visual img {
        max-width: 280px;
    }
}

@media (max-width: 640px) {
    .rechner { padding: 32px 0 56px; }
    .rechner-result { padding: 32px 0; }
    .rechner-form { padding: 20px; }
    .rechner-form__grid { grid-template-columns: 1fr; }
    .rechner-modal__panel { padding: 24px 20px; }
    .rechner-card__value { font-size: 26px; }
    .rechner-card__value--lg { font-size: 34px; }
    .rechner-form__actions { justify-content: stretch; }
    .rechner-form__actions .btn { flex: 1; }
}
