/* ==========================================================================
   Brandstof Bespaar Calculator — Frontend Styles
   Design: modern price-comparison tool
   Colors: blue (interface) · green (besparing) · rood (verlies/BE) · amber (DE)
   ========================================================================== */

/* ── Wrapper ─────────────────────────────────────────────────────────────── */
.fsc-wrapper {
    max-width: 900px;
    margin: 0 auto 2.5rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    color: #1e293b;
    line-height: 1.55;
    background: #f8fafc;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
}

/* ── Hero / header ───────────────────────────────────────────────────────── */
.fsc-hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 65%, #2563eb 100%);
    padding: 2rem 2rem 1.75rem;
    color: #fff;
}

.fsc-hero h1 {
    margin: 0 0 .5rem;
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.2;
    color: #fff;
}

.fsc-hero-sub {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, .82);
    max-width: 560px;
    line-height: 1.55;
}

/* ── Form section ────────────────────────────────────────────────────────── */
.fsc-form-section {
    background: #fff;
    padding: 1.75rem 2rem;
    border-bottom: 1px solid #e2e8f0;
}

/* ── Fuel type pill switcher ─────────────────────────────────────────────── */
.fsc-fuel-row {
    margin-bottom: 1.5rem;
}

.fsc-section-label {
    display: block;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #64748b;
    margin-bottom: 8px;
}

.fsc-fuel-switcher {
    display: inline-flex;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
}

.fsc-fuel-pill {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.fsc-fuel-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.fsc-fuel-pill-label {
    display: block;
    padding: 8px 22px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
    white-space: nowrap;
    user-select: none;
}

.fsc-fuel-pill input:checked + .fsc-fuel-pill-label {
    background: #1d4ed8;
    color: #fff;
    box-shadow: 0 1px 4px rgba(29, 78, 216, .3);
}

.fsc-fuel-pill input:focus-visible + .fsc-fuel-pill-label {
    outline: 2px solid #1d4ed8;
    outline-offset: 2px;
}

/* ── Fuel pill redirect (diesel → aparte pagina, v2.1) ─────────────────── */
.fsc-fuel-pill-redirect {
    display: flex;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
}

.fsc-fuel-pill-redirect .fsc-fuel-pill-label {
    color: #64748b;
    border: 1.5px dashed #cbd5e1;
    background: #f8fafc;
    border-radius: 999px;
    transition: background .15s, color .15s, border-color .15s;
}

.fsc-fuel-pill-redirect:hover .fsc-fuel-pill-label {
    background: #1e3a8a;
    color: #fff;
    border-color: #1e3a8a;
}

/* ── Fuel locked badge (per-page fuel type, v2.0) ──────────────────────── */
.fsc-fuel-locked-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1.5px solid #93c5fd;
    border-radius: 999px;
    padding: 10px 24px;
    margin-bottom: 1.5rem;
}

.fsc-fuel-locked-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.fsc-fuel-locked-label {
    font-size: 15px;
    font-weight: 700;
    color: #1e3a8a;
}

/* ── Form rows ───────────────────────────────────────────────────────────── */
.fsc-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.fsc-form-row:last-of-type { margin-bottom: 0; }

.fsc-form-group {
    flex: 1;
    min-width: 120px;
    display: flex;
    flex-direction: column;
}

.fsc-group-postcode    { flex: 2; }
.fsc-group-housenumber { flex: 1; }

.fsc-form-group label {
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 6px;
    color: #64748b;
}

.fsc-form-group input,
.fsc-form-group select {
    padding: 11px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
    color: #1e293b;
}

.fsc-form-group input:hover,
.fsc-form-group select:hover {
    border-color: #94a3b8;
}

.fsc-form-group input:focus,
.fsc-form-group select:focus {
    border-color: #1d4ed8;
    outline: none;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
}

.fsc-form-group input:focus-visible,
.fsc-form-group select:focus-visible {
    outline: 2px solid #1d4ed8;
    outline-offset: 1px;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
}

.fsc-field-hint { font-size: 11px; color: #94a3b8; margin-top: 5px; }

/* ── Consumption unit row ────────────────────────────────────────────────── */
.fsc-consumption-row {
    display: flex;
    gap: 6px;
}

.fsc-consumption-row input {
    flex: 1;
    min-width: 0;
}

.fsc-unit-select {
    width: auto !important;
    flex: 0 0 auto;
    padding: 11px 8px !important;
    font-size: 13px !important;
    color: #475569;
}

/* ── Consumption reference table ─────────────────────────────────────────── */
.fsc-consumption-ref {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 12px;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.fsc-consumption-ref thead th {
    background: #f8fafc;
    padding: 5px 8px;
    text-align: left;
    font-weight: 700;
    color: #64748b;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .03em;
    border-bottom: 1px solid #e2e8f0;
}

.fsc-consumption-ref thead th:not(:first-child) { text-align: center; }

.fsc-consumption-ref tbody tr {
    border-top: 1px solid #f1f5f9;
    transition: background .1s;
}

.fsc-consumption-ref tbody tr:first-child { border-top: none; }

.fsc-ref-row { cursor: pointer; }
.fsc-ref-row:hover          { background: #eff6ff; }
.fsc-ref-row.fsc-ref-active { background: #dbeafe; }
.fsc-ref-default            { background: #f8fafc; }

.fsc-consumption-ref td {
    padding: 5px 8px;
    vertical-align: middle;
}

.fsc-consumption-ref td:not(:first-child) {
    text-align: center;
    white-space: nowrap;
}

.fsc-ref-example { color: #94a3b8; font-size: 11px; }

/* ── Submit button ───────────────────────────────────────────────────────── */
.fsc-submit-wrap { margin-top: 1.5rem; }

.fsc-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s, transform .1s, box-shadow .15s;
    box-shadow: 0 2px 10px rgba(29, 78, 216, .28);
    letter-spacing: .01em;
}

.fsc-button:hover:not(:disabled) {
    opacity: .92;
    box-shadow: 0 4px 16px rgba(29, 78, 216, .38);
}

.fsc-button:active:not(:disabled) { transform: scale(.99); }

.fsc-button:disabled {
    background: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
}

/* ── Error ───────────────────────────────────────────────────────────────── */
.fsc-error {
    background: #fff7ed;
    border-left: 4px solid #f59e0b;
    border-radius: 6px;
    padding: 12px 16px;
    color: #92400e;
    margin: 0 2rem 1.25rem;
    font-size: 14px;
}

/* ── Results section ─────────────────────────────────────────────────────── */
.fsc-results-section {
    padding: 1.75rem 2rem;
}

/* ── Winner banner ───────────────────────────────────────────────────────── */
.fsc-winner-banner {
    display: none;   /* shown via JS when has-winner or no-winner class is added */
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    text-align: center;
    line-height: 1.4;
}

.fsc-winner-banner.has-winner {
    display: block;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 2px solid #16a34a;
}

.fsc-winner-banner.no-winner {
    display: block;
    background: #fff7f7;
    border: 2px solid #dc2626;
    color: #991b1b;
}

.fsc-winner-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #16a34a;
    margin-bottom: 4px;
}

.fsc-winner-main {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

.fsc-winner-amount {
    font-size: 2.2rem;
    font-weight: 900;
    color: #16a34a;
    display: block;
    line-height: 1.2;
    margin: 6px 0 4px;
}

.fsc-winner-sub {
    font-size: 13px;
    font-weight: 400;
    color: #166534;
    opacity: .85;
}

/* no-winner inner elements */
.fsc-winner-banner.no-winner .fsc-winner-main { color: #991b1b; font-size: 1.15rem; }
.fsc-winner-banner.no-winner .fsc-winner-sub  { color: #991b1b; }

/* ── NL reference bar ────────────────────────────────────────────────────── */
.fsc-nl-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 2rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 1.25rem;
    font-size: 14px;
    align-items: center;
}

/* ── Results grid ────────────────────────────────────────────────────────── */
.fsc-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.fsc-result-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
}

/* ── Option tabs ─────────────────────────────────────────────────────────── */
.fsc-tabs {
    display: flex;
    overflow-x: auto;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    scrollbar-width: none;
}

.fsc-tabs::-webkit-scrollbar { display: none; }

.fsc-tab {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: #64748b;
    white-space: nowrap;
    transition: color .12s, border-color .12s, background .12s;
}

.fsc-tab:hover:not(.active) { background: rgba(0, 0, 0, .03); color: #1e293b; }
.fsc-be .fsc-tab.active { color: #dc2626; border-bottom-color: #dc2626; background: #fff; }
.fsc-de .fsc-tab.active { color: #d97706; border-bottom-color: #d97706; background: #fff; }

/* ── Card header ─────────────────────────────────────────────────────────── */
.fsc-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
}

.fsc-card-header h3 { margin: 0; font-size: 1.1rem; font-weight: 800; }
.fsc-be .fsc-card-header { background: #fef2f2; border-bottom: 3px solid #dc2626; }
.fsc-de .fsc-card-header { background: #fffbeb; border-bottom: 3px solid #d97706; }
.fsc-flag { font-size: 1.8rem; line-height: 1; }

/* ── Crossing / station names ────────────────────────────────────────────── */
.fsc-crossing-name {
    padding: 7px 18px;
    font-size: 12px;
    color: #475569;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 600;
}

.fsc-station-name {
    padding: 5px 18px;
    font-size: 12px;
    color: #94a3b8;
    background: #fbfcfd;
    border-bottom: 1px solid #f1f5f9;
    font-style: italic;
}

/* ── Card body ───────────────────────────────────────────────────────────── */
.fsc-card-body { padding: 14px 18px; flex: 1; }

.fsc-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    gap: 8px;
}

.fsc-stat:last-child { border-bottom: none; }

.fsc-stat-highlight {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 2px solid #e2e8f0 !important;
}

.fsc-label { color: #64748b; }
.fsc-label-sub { font-size: 11px; color: #94a3b8; font-weight: 400; }
.fsc-value { font-weight: 700; white-space: nowrap; }
.fsc-savings-value { font-size: 1.1rem; }
.fsc-savings-value.positive { color: #16a34a; }
.fsc-savings-value.negative { color: #dc2626; }
.fsc-gross-value { font-size: 1rem; }
.fsc-gross-value.positive { color: #16a34a; }
.fsc-gross-value.negative { color: #dc2626; }

/* ── Verdict ─────────────────────────────────────────────────────────────── */
.fsc-verdict {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    border-top: 1px solid #f1f5f9;
}

.fsc-verdict.worth-it     { background: #f0fdf4; color: #166534; }
.fsc-verdict.not-worth-it { background: #fff7f7; color: #991b1b; }

/* ── Map ─────────────────────────────────────────────────────────────────── */
#fsc-map-container { margin-top: .5rem; }

#fsc-map-container h3 {
    margin: 0 0 .75rem;
    font-size: .85rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .05em;
}

#fsc-map {
    width: 100%;
    height: 380px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    margin-bottom: .75rem;
    background: #e8ecef;   /* matches inline style on element → prevents CLS */
}

/* ── Disclaimer ──────────────────────────────────────────────────────────── */
.fsc-disclaimer {
    font-size: 12px;
    color: #94a3b8;
    font-style: italic;
    margin: .5rem 0 0;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .fsc-hero              { padding: 1.5rem 1.25rem; }
    .fsc-hero h1           { font-size: 1.3rem; }
    .fsc-form-section      { padding: 1.25rem; }
    .fsc-results-section   { padding: 1.25rem; }
    .fsc-error             { margin: 0 1.25rem 1rem; }
    .fsc-form-row          { flex-direction: column; }
    .fsc-results-grid      { grid-template-columns: 1fr; }
    .fsc-nl-bar            { flex-direction: column; gap: .3rem; }
    .fsc-winner-banner     { padding: 1.25rem; }
    .fsc-winner-amount     { font-size: 1.75rem; }
    .fsc-fuel-pill-label   { padding: 8px 16px; }
}
