/*
 * Fördermittel-Rechner — Stylesheet
 *
 * CI-Anpassung: Die folgenden CSS Custom Properties im eigenen Theme-CSS überschreiben:
 *
 * .fmr {
 *     --fmr-primary:        #2563eb;   /* Akzentfarbe (aktive Buttons, Slider, Ergebnis-Panel) *\/
 *     --fmr-bg:             #1e1e2e;   /* Hintergrund Formular-Panel *\/
 *     --fmr-bg-toggle:      #2a2a3e;   /* Hintergrund inaktive Toggle-Buttons *\/
 *     --fmr-text:           #ffffff;   /* Haupttextfarbe *\/
 *     --fmr-text-muted:     #aaaaaa;   /* Beschriftungen, Labels *\/
 *     --fmr-border-idle:    #3a3a50;   /* Rahmen Ergebnis-Placeholder *\/
 *     --fmr-radius:         16px;      /* Eckenradius Panels *\/
 *     --fmr-radius-btn:     10px;      /* Eckenradius Buttons *\/
 *     --fmr-submit-bg:      #ffffff;   /* Hintergrund Berechnen-Button *\/
 *     --fmr-submit-color:   #111111;   /* Textfarbe Berechnen-Button *\/
 * }
 */

.fmr {
    --fmr-primary:        #007e88;
    --fmr-bg:             #252728;
    --fmr-bg-toggle:      #2a2a3e;
    --fmr-text:           #ffffff;
    --fmr-text-muted:     #aaaaaa;
    --fmr-border-idle:    #3a3a50;
    --fmr-radius:         16px;
    --fmr-radius-btn:     10px;
    --fmr-submit-bg:      #ffffff;
    --fmr-submit-color:   #111111;

    font-family: inherit;
    color: var(--fmr-text);
}

/* ── Panels: 50/50 via Bootstrap row + equal-height ── */
.fmr .fmr__form-panel {
    background: var(--fmr-bg);
    border-radius: var(--fmr-radius);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    height: 100%;
    box-sizing: border-box;
}

.fmr .fmr__result-panel {
    border-radius: var(--fmr-radius);
    border: 2px dashed var(--fmr-border-idle);
    height: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, border 0.3s;
}

.fmr .fmr__result-panel--active {
    background: var(--fmr-primary);
    border: none;
    align-items: flex-start;
    justify-content: flex-start;
}

/* equal height wrapper */
.fmr .row {
    align-items: stretch;
}

/* ── Labels ── */
.fmr .fmr__label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fmr-text-muted);
    margin-bottom: 0;
}

.fmr .fmr__label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fmr .fmr__income-display {
    font-size: 14px;
    font-weight: 700;
    color: var(--fmr-text-muted);
}

/* ── Toggle Buttons ── */
.fmr .fmr__toggle-group {
    display: flex;
    gap: 10px;
}

.fmr .fmr__toggle {
    flex: 1;
    padding: 14px 10px;
    border-radius: var(--fmr-radius-btn);
    border: none;
    background: var(--fmr-bg-toggle);
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    line-height: 1.2;
}

.fmr .fmr__toggle.fmr__toggle--active {
    background: var(--fmr-primary) !important;
    color: #fff !important;
    border-color: var(--fmr-primary) !important;
}

/* ── Slider ── */
.fmr .fmr__slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.fmr .fmr__slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 4px rgba(0,0,0,0.4);
    cursor: pointer;
}

.fmr .fmr__slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
}

.fmr .fmr__slider-labels {
    position: relative;
    height: 16px;
    margin-top: 6px;
}

.fmr .fmr__slider-labels span {
    position: absolute;
    font-size: 11px;
    color: var(--fmr-text-muted);
    transform: translateX(-50%);
    white-space: nowrap;
}

.fmr .fmr__slider-labels span:first-child {
    transform: translateX(0);
}

.fmr .fmr__slider-labels span:last-child {
    transform: translateX(-100%);
}

/* ── Submit Button ── */
.fmr .fmr__submit {
    width: 100%;
    padding: 18px;
    border-radius: var(--fmr-radius-btn);
    border: none;
    background: var(--fmr-submit-bg) !important;
    color: var(--fmr-submit-color) !important;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: opacity 0.2s;
    margin-top: auto;
}

.fmr .fmr__submit:hover {
    opacity: 0.88;
}

/* ── Result: Placeholder ── */
.fmr .fmr__result-placeholder {
    text-align: center;
    padding: 40px 24px;
    color: #595959 !important;
}

.fmr .fmr__placeholder-icon {
    font-size: 40px;
    color: #595959 !important;
    border: 2px solid #595959;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    line-height: 76px;
    margin: 0 auto 20px;
    text-align: center;
}

.fmr .fmr__result-placeholder h3 {
    font-size: 18px;
    font-weight: 700;
    color: #252728 !important;
    margin: 0 0 10px;
}

.fmr .fmr__result-placeholder p {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    color: #595959 !important;
}

/* ── Result: Content ── */
.fmr .fmr__result-content {
    padding: 36px;
    width: 100%;
}

.fmr .fmr__result-badge {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.8);
    margin-bottom: 12px;
}

.fmr .fmr__result-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.fmr .fmr__result-amount {
    font-size: 64px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 20px;
}

.fmr .fmr__result-amount-clause {
    font-size: 20px;
    line-height: 64px;
    vertical-align: super;
}

.fmr .fmr__result-text {
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 20px;
    opacity: 0.9;
}

.fmr .fmr__result-list {
    list-style: disc;
    padding-left: 20px;
    font-size: 14px;
    margin: 0 0 28px;
    opacity: 0.9;
}

.fmr .fmr__result-list li {
    margin-bottom: 6px;
}

.fmr .fmr__result-source {
    font-size: 11px;
    margin: -12px 0 20px;
}

.fmr .fmr__result-cta {
    display: block;
    width: 100%;
    padding: 16px;
    border-radius: var(--fmr-radius-btn);
    border: 2px solid rgba(255,255,255,0.5);
    background: transparent;
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    box-sizing: border-box;
    transition: background 0.2s;
}

.fmr .fmr__result-cta:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    text-decoration: none;
}

/* ── Barrierefreiheit: Fokus-Indikatoren ── */
.fmr .fmr__toggle:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}

.fmr .fmr__submit:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
}

.fmr .fmr__slider:focus-visible {
    outline: 3px solid var(--fmr-primary, #007e88);
    outline-offset: 4px;
}

.fmr .fmr__result-cta:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
}

/* Barrierefreiheit: Hover-Zustand Toggle (auch für Tastaturnutzer) */
.fmr .fmr__toggle:hover:not(.fmr__toggle--active) {
    background: color-mix(in srgb, var(--fmr-bg-toggle) 70%, white);
}

/* ── Responsive ── */
@media (max-width: 767px) {
    .fmr .fmr__result-panel {
        min-height: 220px;
    }
    .fmr .fmr__result-amount {
        font-size: 48px;
    }
}
