/* ============================================================
   THE GOAT — الاختبار المجاني: الأسئلة الأربعة قبل الاختبار.
   يُحمَّل فوق student-auth.css: الإطار نفسه وألوانه، ومعه ما تنفرد به
   الصفحة — شريط العمر وبطاقات الاختيار وشرائح التخصص.
   هادئةٌ مثل صفحات الحساب: حدودٌ رمادية، واللون للمختار وحده.
   ============================================================ */

/* سطرٌ صغير فوق العنوان: «مجاني بالكامل · بدون تسجيل» */
.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
    color: var(--brand);
    font-size: 0.85rem;
    font-weight: 500;
}

.q-block {
    margin-bottom: 28px;
}

.q-block > .field-label {
    margin-bottom: 10px;
    color: var(--ink);
    font-size: 0.95rem;
}

.q-block.invalid > .field-label {
    color: var(--danger);
}

.q-block.invalid .opt-face,
.q-block.invalid .age-box {
    border-color: var(--danger-line);
}

/* ---------- العمر: شريط ---------- */
.age-box {
    padding: 16px 18px 12px;
    border: 1px solid var(--line-soft);
    border-radius: var(--r);
}

.age-readout {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.age-readout strong {
    min-width: 2ch;
    color: var(--ink);
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.age-readout span {
    color: var(--ink-3);
    font-size: 0.9rem;
}

.age-slider {
    width: 100%;
    height: 32px;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    /* الجزء المملوء حتى الإبهام: --fill يضبطه السكربت، بلونين مسطّحين */
    --fill: 50%;
}

.age-slider:focus-visible {
    outline: none;
}

.age-slider::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(to right, var(--brand) var(--fill), var(--line-soft) var(--fill));
}

[dir="rtl"] .age-slider::-webkit-slider-runnable-track {
    background: linear-gradient(to left, var(--brand) var(--fill), var(--line-soft) var(--fill));
}

.age-slider::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: var(--line-soft);
}

.age-slider::-moz-range-progress {
    height: 6px;
    border-radius: 999px;
    background: var(--brand);
}

.age-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    margin-top: -9px;
    border: 2px solid var(--brand);
    border-radius: 50%;
    background: var(--surface);
}

.age-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border: 2px solid var(--brand);
    border-radius: 50%;
    background: var(--surface);
}

.age-slider:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 4px var(--brand-ring);
}

.age-slider:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 4px var(--brand-ring);
}

.age-scale {
    display: flex;
    justify-content: space-between;
    color: var(--ink-4);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}

.age-box .field-hint {
    margin-top: 8px;
}

/* ---------- بطاقات الاختيار ---------- */
.options {
    display: grid;
    gap: 10px;
}

.options.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.options.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.opt,
.chip {
    position: relative;
}

.opt input,
.chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.opt-face {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 100%;
    min-height: 52px;
    padding: 14px 10px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
    color: var(--ink-2);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.opt-face i {
    color: var(--ink-4);
    font-size: 1.1rem;
    transition: color 0.15s ease;
}

.opt-face .t {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
}

.opt-face .s {
    color: var(--ink-3);
    font-size: 0.75rem;
    line-height: 1.5;
}

.opt-face:hover {
    border-color: var(--ink-4);
}

.opt input:checked + .opt-face {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--brand);
}

.opt input:checked + .opt-face i {
    color: var(--brand);
}

.opt input:focus-visible + .opt-face,
.chip input:focus-visible + .chip-face {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* ---------- التخصص: مجالٌ ثم تخصص ---------- */
.spec-cats .opt-face {
    padding: 12px 8px;
}

.spec-cats .opt-face .t {
    font-size: 0.84rem;
}

.spec-group {
    display: none;
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--line-soft);
    border-radius: var(--r);
    background: var(--surface-2);
}

.spec-group.open {
    display: block;
}

.spec-group .field-hint {
    margin: 0 0 10px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip-face {
    display: inline-block;
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-2);
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.chip-face:hover {
    border-color: var(--ink-4);
}

.chip input:checked + .chip-face {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand-hover);
    font-weight: 500;
    box-shadow: inset 0 0 0 1px var(--brand);
}

/* ---------- الهاتف ---------- */
@media (max-width: 560px) {
    /* المجالات ستة عشر: عمودان لا عمودٌ بطول الشاشة مرّتين */
    .options.spec-cats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    /* الهدف: صفوفٌ أفقية — الأيقونة والعنوان والتلميح في سطر */
    .options.cols-3:not(.spec-cats) {
        grid-template-columns: minmax(0, 1fr);
    }

    .options.cols-3:not(.spec-cats) .opt-face {
        flex-direction: row;
        justify-content: flex-start;
        gap: 10px;
        padding: 12px 14px;
        text-align: start;
    }

    .options.cols-3:not(.spec-cats) .opt-face .s {
        margin-inline-start: auto;
    }
}
