/* ==========================================================================
   Yüzleşme — Kör Nokta Testi
   Sade, açık zeminli, tek vurgu renkli form tasarımı (Typeform/Google Forms
   esintili). Tek font ailesi (Inter), düz kartlar, ince ilerleme çubuğu.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --text: #1A1D29;
    --text-muted: #6B7280;
    --text-faint: #9CA3AF;
    --bg: #FFFFFF;
    --bg-page: #F6F7F9;
    --border: #E5E7EB;
    --border-strong: #D1D5DB;

    --accent: #4F46E5;
    --accent-hover: #4338CA;
    --accent-soft: #EEF2FF;

    --danger: #DC2626;
    --danger-soft: #FEF2F2;
    --success: #16A34A;
    --success-soft: #F0FDF4;

    --radius: 12px;
    --shadow: 0 1px 2px rgba(16,24,40,0.04), 0 4px 16px rgba(16,24,40,0.06);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-page);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.wrap {
    max-width: 640px;
    margin: 48px auto 80px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 40px 44px;
}
.wrap.narrow { max-width: 460px; }
.wrap.wide { max-width: 900px; }

/* ---- Başlıklar ---- */

h1, h2, h3 {
    font-family: inherit;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    margin: 0 0 6px;
}

h1 { font-size: 1.6rem; text-align: center; }

.eyebrow {
    display: block;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.98rem;
    margin: 0 0 28px;
}

.muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.divider { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

/* ---- Formlar ---- */

.name-field { margin: 8px 0 20px; }
input[type="text"] {
    width: 100%;
    background: var(--bg);
    border: 1.5px solid var(--border-strong);
    border-radius: 10px;
    color: var(--text);
    font-family: inherit;
    font-size: 1.05rem;
    padding: 13px 16px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="text"]::placeholder { color: var(--text-faint); }
input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 13px 24px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.96rem;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s ease;
    min-height: 46px;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn-wide { width: 100%; margin-top: 18px; }
.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1.5px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-page); }

.alert {
    background: var(--danger-soft);
    border: 1px solid #FCA5A5;
    color: #991B1B;
    padding: 13px 16px;
    border-radius: 10px;
    margin: 16px 0;
    font-size: 0.92rem;
}
.alert-info {
    background: var(--bg-page);
    border: 1px solid var(--border);
    color: var(--text);
}

/* ---- İlerleme çubuğu ---- */

.progress-track {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}
.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.3s ease;
}
.progress-caption {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 24px;
}

/* ---- Üst bar (test sayfası) ---- */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.86rem;
    color: var(--text-muted);
    margin-bottom: 14px;
    gap: 10px;
}
.topbar .who { color: var(--text); font-weight: 600; }

.topbar-sub { text-align: right; margin: -6px 0 14px; }
.topbar-sub a { color: var(--text-faint); font-size: 0.78rem; }
.topbar-sub a:hover { color: var(--accent); }

.timer {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    background: var(--bg-page);
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 20px;
    color: var(--text);
}
.timer-warning {
    background: var(--danger-soft);
    border-color: #FCA5A5;
    color: var(--danger);
}

/* ---- Soru & şıklar ---- */

.question {
    font-size: 1.28rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--text);
    margin: 4px 0 10px;
}

.hint-note {
    font-size: 0.82rem;
    color: var(--text-faint);
    font-style: italic;
    margin: 0 0 20px;
}

.options { display: flex; flex-direction: column; gap: 10px; }

.option {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 15px 18px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    min-height: 46px;
}
.option:hover { border-color: var(--border-strong); background: var(--bg-page); }
.option:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.letter-seal {
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid var(--border-strong);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.option:has(input:checked) .letter-seal {
    border-color: var(--accent);
    color: #fff;
    background: var(--accent);
}
.opt-text { line-height: 1.5; padding-top: 2px; }

/* ---- Skor & öncelik (results.php) ---- */

.score-block { text-align: center; margin: 8px 0 28px; }

.score-ring {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.score-ring .ring-number {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--text);
}
.score-ring .ring-of {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
}
.score-ring .ring-inner {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.priority-box {
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-left: 4px solid var(--danger);
    padding: 18px 22px;
    border-radius: 4px 10px 10px 4px;
    margin-bottom: 24px;
}
.priority-box h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 8px;
}
.priority-theme {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--danger);
    margin: 2px 0 6px;
}
.priority-clean { border-left-color: var(--success); }
.priority-clean .priority-theme { color: var(--success); }

/* ---- Tablolar (varsayılan: masaüstü) ---- */

table { width: 100%; border-collapse: collapse; margin: 14px 0; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--border); }
th {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    background: var(--bg-page);
}
td { font-size: 0.94rem; }

.badge {
    display: inline-block;
    background: var(--bg-page);
    border: 1px solid var(--border);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
}
.badge-strong { background: var(--danger-soft); border-color: #FCA5A5; color: var(--danger); }
.badge-score { background: var(--accent-soft); border-color: #C7D2FE; color: var(--accent-hover); }

/* ---- Leaderboard ---- */

.rank-num { font-weight: 700; color: var(--text-muted); }
.rank-medal { font-size: 1.1rem; }

.mini-table { font-size: 0.85rem; margin: 8px 0 0; }
.mini-table td { padding: 5px 8px; border-bottom: none; }

details summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.82rem;
    list-style: none;
}
details summary::-webkit-details-marker { display: none; }

/* ---- Yardımcı ---- */

.stack { display: flex; flex-direction: column; gap: 12px; }

/* ==========================================================================
   Mobil (≤ 700px)
   ========================================================================== */

@media (max-width: 700px) {
    .wrap {
        margin: 0;
        padding: 26px 18px 44px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        box-shadow: none;
        min-height: 100vh;
    }

    h1 { font-size: 1.4rem; }
    .question { font-size: 1.12rem; }
    .score-ring { width: 104px; height: 104px; }
    .score-ring .ring-inner { width: 82px; height: 82px; }
    .score-ring .ring-number { font-size: 1.5rem; }
    .priority-theme { font-size: 1.15rem; }

    .option { padding: 13px 14px; gap: 11px; }
    .letter-seal { width: 22px; height: 22px; font-size: 0.72rem; }

    .topbar { font-size: 0.8rem; }

    /* Leaderboard: tablodan karta dönüşüm */
    .leaderboard thead { display: none; }
    .leaderboard, .leaderboard tbody { display: block; width: 100%; }
    .leaderboard tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        row-gap: 8px;
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 14px 16px;
        margin-bottom: 10px;
    }
    .leaderboard tbody tr:nth-child(1) { border-color: #FDE68A; background: #FFFBEB; }
    .leaderboard tbody tr:nth-child(2) { background: var(--bg-page); }
    .leaderboard tbody tr:nth-child(3) { border-color: #FED7AA; background: #FFF7ED; }

    .leaderboard td { border-bottom: none; padding: 0; display: block; }
    .leaderboard td:nth-child(1) { flex: 0 0 auto; font-weight: 700; margin-right: 10px; }
    .leaderboard td:nth-child(2) { flex: 1 1 auto; font-size: 1.05rem; font-weight: 600; }
    .leaderboard td:nth-child(3),
    .leaderboard td:nth-child(4),
    .leaderboard td:nth-child(5),
    .leaderboard td:nth-child(6) {
        flex: 0 0 100%;
        padding-top: 8px;
        border-top: 1px dashed var(--border);
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }
    .leaderboard td[data-label]::before {
        content: attr(data-label);
        font-size: 0.68rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-faint);
        flex: none;
    }
    .leaderboard td:nth-child(6) { justify-content: flex-start; }
    .leaderboard details { width: 100%; }
}

@media (max-width: 360px) {
    .wrap { padding: 20px 14px 36px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* Sonuç sayfası: önerilen bölüm referansı */
.episode-ref {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--accent);
    margin: 0 0 8px;
}
