/* ═══════════════════════════════════════════════
   FCE Red Flag Simulator — Mobile-First Styles
   Brand: navy #0B1D3A, gold #D4A843
   ═══════════════════════════════════════════════ */

.fce-rfs-wrap {
    --navy: #0B1D3A;
    --navy-light: #132D52;
    --navy-mid: #1B3A5C;
    --gold: #D4A843;
    --gold-light: #F2DCA0;
    --gold-bg: rgba(212,168,67,0.08);
    --surface: #F7F5F0;
    --card: #FFFFFF;
    --text: #1A1A2E;
    --text-sec: #5A6178;
    --text-muted: #8B90A0;
    --border: #E2DFD8;
    --green: #1A8C5E;
    --green-bg: #E8F8F0;
    --red: #C0392B;
    --red-bg: #FDECEB;
    --orange: #D47B2A;
    --orange-bg: #FEF4E8;
    --blue: #2E6DA4;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 4px 20px rgba(11,29,58,0.08);
    --shadow-lg: 0 8px 32px rgba(11,29,58,0.12);
    --tap: 44px;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    line-height: 1.6;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

@media (min-width: 768px) {
    .fce-rfs-wrap { padding: 0 24px; }
}
@media (min-width: 960px) {
    .fce-rfs-wrap { padding: 0; }
}

.fce-rfs-wrap *, .fce-rfs-wrap *::before, .fce-rfs-wrap *::after {
    box-sizing: border-box;
}

/* ── HERO ── */
.fce-rfs-hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 60%, var(--navy-mid) 100%);
    border-radius: var(--radius);
    padding: 28px 20px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    text-align: center;
}
@media (min-width: 768px) {
    .fce-rfs-hero {
        border-radius: var(--radius-lg);
        padding: 44px 32px;
    }
}
.fce-rfs-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -15%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(212,168,67,0.1) 0%, transparent 70%);
    border-radius: 50%;
}
.fce-rfs-hero-icon {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
}
@media (min-width: 768px) {
    .fce-rfs-hero-icon { font-size: 48px; }
}
.fce-rfs-hero-label {
    display: inline-block;
    background: rgba(212,168,67,0.15);
    color: var(--gold);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
    border: 1px solid rgba(212,168,67,0.25);
}
@media (min-width: 768px) {
    .fce-rfs-hero-label { font-size: 11px; padding: 5px 14px; }
}
.fce-rfs-hero h2 {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.2;
}
@media (min-width: 768px) {
    .fce-rfs-hero h2 { font-size: 30px; margin-bottom: 10px; }
}
.fce-rfs-hero p {
    color: rgba(255,255,255,0.65);
    font-size: 13px;
    margin: 0;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}
@media (min-width: 768px) {
    .fce-rfs-hero p { font-size: 15px; }
}

/* ── SCENARIO GRID ── */
.fce-rfs-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 32px;
}
@media (min-width: 480px) {
    .fce-rfs-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
    .fce-rfs-grid { gap: 16px; }
}

/* ── SCENARIO CARD ── */
.fce-rfs-scenario-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: var(--tap);
}
@media (min-width: 768px) {
    .fce-rfs-scenario-card { padding: 20px; gap: 10px; }
}
.fce-rfs-scenario-card:hover,
.fce-rfs-scenario-card:active {
    border-color: var(--gold);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.fce-rfs-scenario-card:active {
    transform: translateY(0);
}
.fce-rfs-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
}
.fce-rfs-card-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}
@media (min-width: 768px) {
    .fce-rfs-card-icon { font-size: 32px; }
}
.fce-rfs-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
}
@media (min-width: 768px) {
    .fce-rfs-card-title { font-size: 15px; }
}
.fce-rfs-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.fce-rfs-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
}
.fce-rfs-tag-cat {
    background: var(--gold-bg);
    color: var(--gold);
    border: 1px solid rgba(212,168,67,0.2);
}
.fce-rfs-tag-diff {
    background: var(--surface);
    color: var(--text-sec);
    border: 1px solid var(--border);
}

/* ── SIMULATOR VIEW ── */
.fce-rfs-sim {
    animation: fce-rfs-fadeIn 0.3s ease;
}
@keyframes fce-rfs-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Back button */
.fce-rfs-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sec);
    cursor: pointer;
    margin-bottom: 16px;
    min-height: var(--tap);
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: all 0.2s;
}
.fce-rfs-back:hover { border-color: var(--navy); color: var(--navy); }

/* Progress bar */
.fce-rfs-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}
.fce-rfs-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.fce-rfs-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--navy));
    border-radius: 3px;
    transition: width 0.4s ease;
}
.fce-rfs-progress-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Score display */
.fce-rfs-score-live {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--gold-bg);
    border: 1px solid rgba(212,168,67,0.2);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 16px;
}

/* Briefing */
.fce-rfs-briefing {
    background: var(--navy);
    color: rgba(255,255,255,0.85);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.7;
    position: relative;
}
@media (min-width: 768px) {
    .fce-rfs-briefing { padding: 24px; font-size: 15px; }
}
.fce-rfs-briefing strong {
    color: var(--gold-light);
}
.fce-rfs-briefing-label {
    display: inline-block;
    background: rgba(212,168,67,0.15);
    color: var(--gold);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 10px;
}

/* Question */
.fce-rfs-question {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 16px;
    line-height: 1.4;
}
@media (min-width: 768px) {
    .fce-rfs-question { font-size: 18px; margin-bottom: 20px; }
}

/* Options */
.fce-rfs-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}
@media (min-width: 768px) {
    .fce-rfs-options { gap: 12px; }
}

.fce-rfs-option {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: var(--tap);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    position: relative;
}
@media (min-width: 768px) {
    .fce-rfs-option { padding: 16px 20px; font-size: 15px; }
}

.fce-rfs-option:hover:not(.selected):not(.disabled) {
    border-color: var(--gold);
    background: var(--gold-bg);
}
.fce-rfs-option:active:not(.selected):not(.disabled) {
    transform: scale(0.99);
}

.fce-rfs-option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-sec);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.2s;
}

.fce-rfs-option.selected .fce-rfs-option-letter {
    color: #fff;
}
.fce-rfs-option.selected.correct .fce-rfs-option-letter {
    background: var(--green);
}
.fce-rfs-option.selected.partial .fce-rfs-option-letter {
    background: var(--orange);
}
.fce-rfs-option.selected.wrong .fce-rfs-option-letter {
    background: var(--red);
}

/* Selected states */
.fce-rfs-option.selected.correct {
    border-color: var(--green);
    background: var(--green-bg);
}
.fce-rfs-option.selected.partial {
    border-color: var(--orange);
    background: var(--orange-bg);
}
.fce-rfs-option.selected.wrong {
    border-color: var(--red);
    background: var(--red-bg);
}

.fce-rfs-option.disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

/* Feedback */
.fce-rfs-feedback {
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
    animation: fce-rfs-fadeIn 0.3s ease;
}
@media (min-width: 768px) {
    .fce-rfs-feedback { padding: 20px; }
}
.fce-rfs-feedback.correct { background: var(--green-bg); border-left: 4px solid var(--green); }
.fce-rfs-feedback.partial { background: var(--orange-bg); border-left: 4px solid var(--orange); }
.fce-rfs-feedback.wrong   { background: var(--red-bg); border-left: 4px solid var(--red); }

.fce-rfs-feedback-label {
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}
.fce-rfs-feedback.correct .fce-rfs-feedback-label { color: var(--green); }
.fce-rfs-feedback.partial .fce-rfs-feedback-label { color: var(--orange); }
.fce-rfs-feedback.wrong .fce-rfs-feedback-label   { color: var(--red); }

.fce-rfs-feedback-score {
    font-weight: 700;
    font-size: 13px;
    margin-top: 8px;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(0,0,0,0.05);
}

/* Continue button */
.fce-rfs-continue {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    min-height: var(--tap);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: all 0.2s;
    margin-bottom: 16px;
}
.fce-rfs-continue:hover { background: var(--navy-light); }
.fce-rfs-continue:active { transform: scale(0.98); }

/* ── RESULTS SCREEN ── */
.fce-rfs-results {
    text-align: center;
    animation: fce-rfs-fadeIn 0.4s ease;
}

.fce-rfs-results-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 20px;
    margin-bottom: 20px;
}
@media (min-width: 768px) {
    .fce-rfs-results-card { padding: 40px 32px; }
}

.fce-rfs-results-icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}
@media (min-width: 768px) {
    .fce-rfs-results-icon { font-size: 56px; }
}

.fce-rfs-results-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text);
}
@media (min-width: 768px) {
    .fce-rfs-results-title { font-size: 26px; }
}

.fce-rfs-results-subtitle {
    font-size: 14px;
    color: var(--text-sec);
    margin: 0 0 24px;
}

/* Score ring */
.fce-rfs-score-ring {
    width: 140px;
    height: 140px;
    margin: 0 auto 20px;
    position: relative;
}
@media (min-width: 768px) {
    .fce-rfs-score-ring { width: 160px; height: 160px; }
}
.fce-rfs-score-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.fce-rfs-score-ring-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 8;
}
.fce-rfs-score-ring-fill {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}
.fce-rfs-score-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}
.fce-rfs-score-num {
    display: block;
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
}
@media (min-width: 768px) {
    .fce-rfs-score-num { font-size: 36px; }
}
.fce-rfs-score-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Rating badge */
.fce-rfs-rating {
    display: inline-block;
    padding: 6px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 24px;
}
.fce-rfs-rating.excellent { background: var(--green-bg); color: var(--green); border: 2px solid var(--green); }
.fce-rfs-rating.good      { background: var(--gold-bg); color: var(--gold); border: 2px solid var(--gold); }
.fce-rfs-rating.needs-work { background: var(--orange-bg); color: var(--orange); border: 2px solid var(--orange); }
.fce-rfs-rating.poor      { background: var(--red-bg); color: var(--red); border: 2px solid var(--red); }

/* Action buttons */
.fce-rfs-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
@media (min-width: 480px) {
    .fce-rfs-actions { flex-direction: row; justify-content: center; }
}

.fce-rfs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    min-height: var(--tap);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: all 0.2s;
    border: 2px solid transparent;
    text-decoration: none;
}
.fce-rfs-btn:active { transform: scale(0.97); }

.fce-rfs-btn-primary {
    background: var(--navy);
    color: #fff;
}
.fce-rfs-btn-primary:hover { background: var(--navy-light); }

.fce-rfs-btn-outline {
    background: var(--card);
    color: var(--navy);
    border-color: var(--border);
}
.fce-rfs-btn-outline:hover { border-color: var(--navy); }

.fce-rfs-btn-gold {
    background: var(--gold);
    color: var(--navy);
}
.fce-rfs-btn-gold:hover { background: #c49a38; }

/* CTA */
.fce-rfs-cta {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    border-radius: var(--radius);
    padding: 24px 20px;
    text-align: center;
    margin-top: 20px;
}
@media (min-width: 768px) {
    .fce-rfs-cta { padding: 32px; }
}
.fce-rfs-cta h4 {
    color: #fff;
    font-size: 16px;
    margin: 0 0 8px;
}
@media (min-width: 768px) {
    .fce-rfs-cta h4 { font-size: 18px; }
}
.fce-rfs-cta p {
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    margin: 0 0 16px;
}
.fce-rfs-cta .fce-rfs-btn-gold {
    border: none;
}

/* ── NOSCRIPT ── */
.fce-rfs-noscript {
    background: var(--red-bg);
    border: 2px solid var(--red);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    color: var(--red);
    font-weight: 600;
}

/* ── SAFE AREAS ── */
@supports (padding: env(safe-area-inset-bottom)) {
    .fce-rfs-wrap {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
    @media (min-width: 960px) {
        .fce-rfs-wrap { padding-left: 0; padding-right: 0; }
    }
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
    .fce-rfs-sim, .fce-rfs-feedback, .fce-rfs-results,
    .fce-rfs-option, .fce-rfs-scenario-card {
        animation: none !important;
        transition-duration: 0.01s !important;
    }
}

/* ── PRINT ── */
@media print {
    .fce-rfs-back, .fce-rfs-actions, .fce-rfs-cta { display: none !important; }
}
