/* ==========================================================================
   IQ Test - public pages
   ========================================================================== */

:root {
    --iq-navy: #0a1628;
    --iq-navy-mid: #0e1f3d;
    --iq-navy-soft: #16294a;
    --iq-blue: #0d5ff9;
    --iq-blue-dark: #0a4fd6;
    --iq-green: #17b26a;
    --iq-red: #e5484d;
    --iq-amber: #f5a524;
    --iq-text: #1c2b45;
    --iq-muted: #64748b;
    --iq-line: #e4e9f2;
    --iq-bg: #f4f7fc;
    --iq-white: #ffffff;
    --iq-radius: 18px;
    --iq-shadow: 0 18px 45px rgba(10, 22, 40, 0.08);
    --iq-shadow-sm: 0 8px 22px rgba(10, 22, 40, 0.06);
}

.iq-page {
    background: var(--iq-bg);
    color: var(--iq-text);
    font-family: 'Urbanist', 'Segoe UI', sans-serif;
}

.iq-page .iq-main {
    padding: 60px 0 90px;
}

/* ---------------------------------- Layout -------------------------------- */

.iq-card {
    background: var(--iq-white);
    border: 1px solid var(--iq-line);
    border-radius: var(--iq-radius);
    padding: 28px;
    box-shadow: var(--iq-shadow-sm);
}

.iq-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--iq-navy);
    margin-bottom: 18px;
}

.iq-card-title i {
    color: var(--iq-blue);
}

/* ----------------------------------- Hero --------------------------------- */

.iq-hero {
    padding: 10px 0 40px;
}

.iq-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(13, 95, 249, 0.1);
    color: var(--iq-blue);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 8px 16px;
    border-radius: 999px;
    margin-bottom: 18px;
}

.iq-hero-title {
    font-size: clamp(2.1rem, 4vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    color: var(--iq-navy);
    margin-bottom: 18px;
}

.iq-hero-title span {
    color: var(--iq-blue);
}

.iq-hero-text {
    font-size: 1.06rem;
    color: var(--iq-muted);
    line-height: 1.7;
    max-width: 620px;
    margin-bottom: 26px;
}

.iq-hero-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 28px;
    max-width: 560px;
}

.iq-stat {
    background: var(--iq-white);
    border: 1px solid var(--iq-line);
    border-radius: 14px;
    padding: 14px 10px;
    text-align: center;
    box-shadow: var(--iq-shadow-sm);
}

.iq-stat strong {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--iq-navy);
    line-height: 1.2;
}

.iq-stat span {
    font-size: 0.78rem;
    color: var(--iq-muted);
    font-weight: 600;
}

.iq-hero-note {
    color: var(--iq-muted);
    font-size: 0.9rem;
    margin: 14px 0 0;
}

.iq-alert {
    border-radius: 12px;
    font-size: 0.95rem;
    border: 0;
}

/* --------------------------------- Buttons -------------------------------- */

.iq-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 2px solid transparent;
    border-radius: 999px;
    padding: 13px 28px;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.iq-btn:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.iq-btn-primary {
    background: var(--iq-blue);
    color: #fff;
    box-shadow: 0 12px 26px rgba(13, 95, 249, 0.28);
}

.iq-btn-primary:hover,
.iq-btn-primary:focus {
    background: var(--iq-blue-dark);
    color: #fff;
}

.iq-btn-outline {
    background: #fff;
    border-color: var(--iq-line);
    color: var(--iq-navy);
}

.iq-btn-outline:hover,
.iq-btn-outline:focus {
    border-color: var(--iq-blue);
    color: var(--iq-blue);
}

.iq-btn-submit {
    background: var(--iq-navy);
    color: #fff;
    margin-top: 20px;
    box-shadow: 0 12px 26px rgba(10, 22, 40, 0.22);
}

.iq-btn-submit:hover,
.iq-btn-submit:focus {
    background: var(--iq-navy-soft);
    color: #fff;
}

.iq-btn:disabled,
.iq-btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.iq-link {
    color: var(--iq-blue);
    font-weight: 700;
    text-decoration: none;
}

/* ------------------------------ Instructions ------------------------------ */

.iq-instructions {
    padding: 30px;
}

.iq-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.iq-list li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 11px 0;
    border-bottom: 1px dashed var(--iq-line);
    color: var(--iq-text);
    font-size: 0.97rem;
    line-height: 1.55;
}

.iq-list li:last-child {
    border-bottom: 0;
}

.iq-list li i {
    color: var(--iq-green);
    font-size: 0.85rem;
    margin-top: 4px;
}

.iq-tip {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 18px;
    background: #fff8e8;
    border: 1px solid #ffe6b0;
    color: #7a5a0d;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 0.92rem;
    line-height: 1.55;
}

.iq-tip i {
    margin-top: 2px;
    color: var(--iq-amber);
}

/* --------------------------------- Sections ------------------------------- */

.iq-section {
    padding-top: 30px;
}

.iq-table thead th {
    border: 0;
    color: var(--iq-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.iq-table tbody td {
    border-color: var(--iq-line);
    font-weight: 600;
    color: var(--iq-text);
}

/* ------------------------------- Test topbar ------------------------------ */

.iq-test-page .iq-main {
    padding-top: 40px;
}

.iq-test-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.iq-test-heading {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--iq-navy);
    margin-bottom: 4px;
}

.iq-test-subheading {
    color: var(--iq-muted);
    font-size: 0.95rem;
}

.iq-timer {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    background: var(--iq-navy);
    color: #fff;
    border-radius: 16px;
    padding: 12px 22px;
    box-shadow: var(--iq-shadow);
}

.iq-timer-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.7;
}

.iq-timer-value {
    font-size: 1.7rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.iq-timer.is-warning {
    background: #8a4b00;
    animation: iq-pulse 1s ease-in-out infinite;
}

.iq-timer.is-danger {
    background: #8c1d22;
    animation: iq-pulse 0.8s ease-in-out infinite;
}

@keyframes iq-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.iq-progress-wrap {
    margin-bottom: 24px;
}

.iq-progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--iq-muted);
    margin-bottom: 8px;
}

.iq-progress {
    height: 10px;
    background: #e6ecf6;
    border-radius: 999px;
    overflow: hidden;
}

.iq-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--iq-blue), #4f8bff);
    border-radius: 999px;
    transition: width 0.25s ease;
}

/* --------------------------------- Question ------------------------------- */

.iq-question-card {
    padding: 30px;
}

.iq-question-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.iq-question-number {
    display: inline-flex;
    align-items: center;
    background: rgba(13, 95, 249, 0.1);
    color: var(--iq-blue);
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.iq-question-category {
    color: var(--iq-muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.iq-question-text {
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    font-weight: 700;
    line-height: 1.45;
    color: var(--iq-navy);
    margin-bottom: 22px;
}

.iq-question-image-wrap {
    margin-bottom: 20px;
    text-align: center;
}

.iq-question-image-wrap img {
    max-width: 100%;
    max-height: 320px;
    border-radius: 12px;
    border: 1px solid var(--iq-line);
    object-fit: contain;
}

.iq-options {
    display: grid;
    gap: 12px;
}

.iq-option {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    text-align: left;
    background: #fbfcfe;
    border: 2px solid var(--iq-line);
    border-radius: 14px;
    padding: 15px 18px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--iq-text);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
}

.iq-option:hover {
    border-color: #b9cdf4;
    background: #f4f8ff;
}

.iq-option.is-selected {
    border-color: var(--iq-blue);
    background: #eef4ff;
    box-shadow: 0 8px 20px rgba(13, 95, 249, 0.14);
}

.iq-option-key {
    flex: 0 0 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e9eff9;
    color: var(--iq-navy);
    font-weight: 800;
    font-size: 0.92rem;
}

.iq-option.is-selected .iq-option-key {
    background: var(--iq-blue);
    color: #fff;
}

.iq-option-text {
    flex: 1;
    line-height: 1.5;
}

.iq-question-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--iq-line);
}

.iq-save-status {
    color: var(--iq-green);
    font-size: 0.85rem;
    font-weight: 700;
    min-height: 1.2em;
}

.iq-save-status.is-error {
    color: var(--iq-red);
}

/* --------------------------------- Sidebar -------------------------------- */

.iq-side-card {
    position: sticky;
    top: 20px;
}

.iq-side-hint {
    color: var(--iq-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 14px;
}

.iq-palette {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 9px;
}

.iq-palette-btn {
    aspect-ratio: 1 / 1;
    border: 2px solid var(--iq-line);
    background: #fff;
    border-radius: 11px;
    font-weight: 700;
    color: var(--iq-muted);
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.iq-palette-btn:hover {
    border-color: #b9cdf4;
}

.iq-palette-btn.is-answered {
    background: #e7f8ef;
    border-color: #9fe3bd;
    color: #0d7a45;
}

.iq-palette-btn.is-current {
    border-color: var(--iq-blue);
    background: var(--iq-blue);
    color: #fff;
    box-shadow: 0 6px 14px rgba(13, 95, 249, 0.3);
}

/* ---------------------------------- Modal --------------------------------- */

.iq-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.iq-modal[hidden] {
    display: none;
}

.iq-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 14, 27, 0.62);
    backdrop-filter: blur(2px);
}

.iq-modal-box {
    position: relative;
    background: #fff;
    border-radius: 18px;
    padding: 32px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
}

.iq-modal-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--iq-navy);
    margin-bottom: 10px;
}

.iq-modal-text {
    color: var(--iq-muted);
    margin-bottom: 0;
}

/* --------------------------------- Results -------------------------------- */

.iq-result-page .iq-main {
    padding-top: 40px;
}

.iq-result-hero {
    border-radius: 22px;
    padding: 38px;
    color: #fff;
    margin-bottom: 22px;
    background: linear-gradient(120deg, #0a1628 0%, #123264 60%, #0d5ff9 140%);
    box-shadow: var(--iq-shadow);
}

.iq-result-hero.is-review {
    background: linear-gradient(120deg, #1b2030 0%, #333d55 65%, #5d6b8a 140%);
}

.iq-result-hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    flex-wrap: wrap;
}

.iq-result-hero .iq-eyebrow {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    margin-bottom: 14px;
}

.iq-result-title {
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    font-weight: 800;
    margin-bottom: 10px;
    color: #fff;
}

.iq-result-subtitle {
    color: rgba(255, 255, 255, 0.78);
    font-size: 1rem;
}

.iq-score-ring {
    --size: 150px;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: conic-gradient(#7ce3aa calc(var(--score) * 1%), rgba(255, 255, 255, 0.18) 0);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.iq-result-hero.is-review .iq-score-ring {
    background: conic-gradient(#ffcf7a calc(var(--score) * 1%), rgba(255, 255, 255, 0.18) 0);
}

.iq-score-ring-inner {
    width: calc(var(--size) - 26px);
    height: calc(var(--size) - 26px);
    border-radius: 50%;
    background: #0d1b31;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.iq-score-ring-inner strong {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.1;
}

.iq-score-ring-inner span {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.7;
}

.iq-result-stats {
    margin-bottom: 22px;
}

.iq-mini-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px 22px;
}

.iq-mini-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--iq-muted);
}

.iq-mini-stat strong {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--iq-navy);
}

.iq-category-card {
    margin-bottom: 22px;
}

.iq-category-list {
    display: grid;
    gap: 18px;
}

.iq-category-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
}

.iq-category-name {
    font-weight: 700;
    color: var(--iq-navy);
}

.iq-category-value {
    color: var(--iq-muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.iq-category-bar {
    height: 10px;
    background: #e6ecf6;
    border-radius: 999px;
    overflow: hidden;
}

.iq-category-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #17b26a, #55d396);
    border-radius: 999px;
}

.iq-review-legend {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--iq-muted);
}

.iq-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.iq-dot-correct { background: #9fe3bd; }
.iq-dot-selected { background: #b9cdf4; }

.iq-review-item {
    border: 1px solid var(--iq-line);
    border-left: 5px solid var(--iq-line);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
    background: #fcfdff;
}

.iq-review-item.is-correct { border-left-color: var(--iq-green); }
.iq-review-item.is-wrong { border-left-color: var(--iq-red); }
.iq-review-item.is-unanswered { border-left-color: #a0aab8; }

.iq-review-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.iq-review-question {
    font-size: 1rem;
    font-weight: 700;
    color: var(--iq-navy);
    line-height: 1.5;
    margin: 0;
    display: flex;
    gap: 10px;
}

.iq-review-number {
    flex: 0 0 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--iq-navy);
    color: #fff;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 800;
}

.iq-review-badge {
    flex: 0 0 auto;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eef1f6;
    color: var(--iq-muted);
}

.iq-review-item.is-correct .iq-review-badge {
    background: #e7f8ef;
    color: #0d7a45;
}

.iq-review-item.is-wrong .iq-review-badge {
    background: #fdecec;
    color: #b32126;
}

.iq-review-options {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.iq-review-options li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--iq-line);
    border-radius: 10px;
    background: #fff;
    font-size: 0.95rem;
    color: var(--iq-text);
}

.iq-review-options li.is-correct-option {
    border-color: #9fe3bd;
    background: #f1fcf6;
}

.iq-review-options li.is-selected-option:not(.is-correct-option) {
    border-color: #f2b6b8;
    background: #fff6f6;
}

.iq-option-key {
    flex: 0 0 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #eef2f8;
    color: var(--iq-navy);
    font-weight: 800;
    font-size: 0.82rem;
}

.is-correct-option .iq-option-key {
    background: var(--iq-green);
    color: #fff;
}

.is-selected-option:not(.is-correct-option) .iq-option-key {
    background: var(--iq-red);
    color: #fff;
}

.iq-option-text {
    flex: 1;
    line-height: 1.45;
}

.iq-option-tag {
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 10px;
    border-radius: 999px;
}

.iq-tag-correct {
    background: #d7f5e5;
    color: #0d7a45;
}

.iq-tag-selected {
    background: #fde3e3;
    color: #b32126;
}

.iq-explanation {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 14px;
    background: #f2f7ff;
    border-radius: 10px;
    padding: 12px 14px;
    color: #294a7a;
    font-size: 0.9rem;
    line-height: 1.55;
}

.iq-explanation i {
    margin-top: 2px;
    color: var(--iq-blue);
}

.iq-result-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
}

/* -------------------------------- Responsive ------------------------------ */

@media (max-width: 991.98px) {
    .iq-page .iq-main {
        padding: 40px 0 70px;
    }

    .iq-side-card {
        position: static;
    }

    .iq-hero-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .iq-result-hero {
        padding: 28px;
    }
}

@media (max-width: 767.98px) {
    .iq-card {
        padding: 22px;
    }

    .iq-question-card {
        padding: 22px;
    }

    .iq-test-topbar {
        align-items: flex-start;
    }

    .iq-timer {
        min-width: 130px;
        padding: 10px 18px;
    }

    .iq-timer-value {
        font-size: 1.45rem;
    }

    .iq-question-footer {
        justify-content: space-between;
    }

    .iq-question-footer .iq-btn {
        padding: 12px 20px;
        font-size: 0.92rem;
    }

    .iq-save-status {
        order: 3;
        width: 100%;
        text-align: center;
        margin-top: 6px;
    }

    .iq-result-hero-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .iq-score-ring {
        --size: 130px;
    }

    .iq-review-head {
        flex-direction: column;
    }

    .iq-review-options li {
        flex-wrap: wrap;
    }

    .iq-option-tag {
        margin-left: 42px;
    }
}

@media (max-width: 575.98px) {
    .iq-page .iq-main {
        padding: 28px 0 60px;
    }

    .iq-hero-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .iq-palette {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .iq-btn {
        width: 100%;
    }

    .iq-question-footer .iq-btn {
        width: calc(50% - 6px);
    }

    .iq-result-actions form {
        width: 100%;
    }
}

/* ========================================
   PERFORMANCE BAND
======================================== */
.iq-band-card {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    border-left: 6px solid #0d5ff9;
}

.iq-band-badge {
    flex: 0 0 auto;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffffff;
    background: #0d5ff9;
    white-space: nowrap;
}

.iq-band-copy {
    min-width: 0;
}

.iq-band-note {
    font-size: 0.82rem;
    color: #6b7280;
}

.iq-band-outstanding {
    border-left-color: #128a4b;
}

.iq-band-outstanding .iq-band-badge {
    background: #128a4b;
}

.iq-band-very-good {
    border-left-color: #0d7fd4;
}

.iq-band-very-good .iq-band-badge {
    background: #0d7fd4;
}

.iq-band-good {
    border-left-color: #0d5ff9;
}

.iq-band-good .iq-band-badge {
    background: #0d5ff9;
}

.iq-band-average {
    border-left-color: #d98b09;
}

.iq-band-average .iq-band-badge {
    background: #d98b09;
}

.iq-band-needs-improvement {
    border-left-color: #d64545;
}

.iq-band-needs-improvement .iq-band-badge {
    background: #d64545;
}

@media (max-width: 575.98px) {
    .iq-band-card {
        flex-direction: column;
        gap: 10px;
    }
}
