/* ==========================================================================
   IQ Test page shell
   Loads after css/iq-test.css so these layout and responsive refinements
   override the scoped widget defaults without touching other pages.
   ========================================================================== */

.iq-test-page {
    --iq-page-radius: 32px;
    --iq-page-border: rgba(10, 25, 47, 0.09);
}

.iq-test-page img {
    max-width: 100%;
}

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

.iq-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(8rem, 15vw, 11rem) 0 clamp(4.5rem, 8vw, 7rem);
    background: var(--gradient-navy);
    color: #fff;
    isolation: isolate;
}

.iq-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(circle at 82% 18%, rgba(0, 119, 255, 0.3), transparent 43%),
        radial-gradient(circle at 12% 88%, rgba(255, 184, 28, 0.16), transparent 42%);
    pointer-events: none;
}

.iq-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 78%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 78%);
    pointer-events: none;
}

.iq-hero__inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
    gap: clamp(2.5rem, 6vw, 5rem);
    align-items: center;
}

.iq-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--brand-gold);
}

.iq-eyebrow::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 5px rgba(255, 184, 28, 0.14);
}

.iq-eyebrow--light {
    color: var(--brand-gold);
}

.iq-hero h1 {
    max-width: 760px;
    margin: 0.9rem 0 1.1rem;
    font-size: clamp(2.55rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.035em;
    color: #fff;
}

.iq-hero h1 span {
    color: var(--brand-gold);
}

.iq-hero__lead {
    max-width: 610px;
    margin: 0;
    font-size: clamp(1rem, 1.5vw, 1.12rem);
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.72);
}

.iq-hero__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 1.5rem 0 1.8rem;
}

.iq-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.76rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.iq-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.iq-hero__actions .btn {
    padding: 0.95rem 1.7rem;
    font-size: 0.95rem;
}

.iq-hero__visual {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 350px;
}

.iq-hero__score {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: min(100%, 330px);
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 22%, rgba(255, 184, 28, 0.22), transparent 55%),
        rgba(255, 255, 255, 0.055);
    box-shadow: 0 35px 90px rgba(0, 0, 0, 0.34);
}

.iq-hero__score::before {
    content: '';
    position: absolute;
    inset: 24px;
    border: 1px dashed rgba(255, 255, 255, 0.24);
    border-radius: 50%;
    animation: iqRingSpin 34s linear infinite;
}

.iq-hero__score::after {
    content: '';
    position: absolute;
    inset: 16%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 119, 255, 0.14), transparent 68%);
    pointer-events: none;
}

.iq-hero__score span,
.iq-hero__score small {
    position: relative;
    z-index: 1;
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.iq-hero__score span {
    font-size: 0.72rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.62);
}

.iq-hero__score strong {
    position: relative;
    z-index: 1;
    margin: 0.1rem 0;
    font-family: 'Outfit', sans-serif;
    font-size: clamp(4.5rem, 9vw, 6.3rem);
    font-weight: 800;
    line-height: 0.9;
    color: var(--brand-gold);
    letter-spacing: -0.06em;
}

.iq-hero__score small {
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
}

@keyframes iqRingSpin {
    to {
        transform: rotate(360deg);
    }
}

/* --------------------------------------------------------------------------
   Widget shell
   -------------------------------------------------------------------------- */

.iq-test-page #iq-test {
    scroll-margin-top: 5rem;
}

.iq-page--page {
    padding: clamp(2.5rem, 6vw, 4.5rem) 0;
    background: transparent;
    background-image: none;
}

.iq-test-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: clamp(1rem, 2.5vw, 2rem);
    border: 1px solid var(--iq-page-border);
    border-radius: var(--iq-page-radius);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 30px 80px rgba(10, 25, 47, 0.12);
}

.iq-test-shell__intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.25rem 0.35rem 1.25rem;
}

.iq-test-shell__eyebrow {
    display: block;
    margin-bottom: 0.2rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brand-blue);
}

.iq-test-shell__intro h2 {
    margin: 0;
    font-size: clamp(1.2rem, 2vw, 1.55rem);
    font-weight: 800;
    color: var(--brand-navy);
}

.iq-test-shell__status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
}

.iq-test-shell__status > span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

/* --------------------------------------------------------------------------
   Widget refinements
   -------------------------------------------------------------------------- */

.iq-page .iq-widget {
    max-width: 100%;
    padding: 0;
}

.iq-page .iq-top-bar {
    top: 1rem;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(10, 25, 47, 0.98), rgba(17, 34, 64, 0.98));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.iq-page .iq-title-box h2 {
    font-size: clamp(1.2rem, 2.2vw, 1.5rem);
}

.iq-page .main-mode-switcher {
    max-width: 100%;
}

.iq-page .mode-switch-tab {
    flex: 0 1 auto;
}

.iq-page .score-pill {
    min-width: 88px;
}

.iq-page .q-card {
    border-width: 1.5px;
    border-radius: 20px;
    padding: clamp(1.1rem, 2vw, 1.55rem);
}

.iq-page .q-card:hover {
    transform: translateY(-1px);
}

.iq-page .questions-container {
    gap: 1rem;
}

.iq-page .category-tabs {
    gap: 0.5rem;
}

.iq-page .cat-tab-btn {
    flex: 0 1 auto;
}

.iq-page .group-info-bar {
    padding: 0 0.15rem;
}

.iq-page .reading-search-wrap {
    min-width: 0;
    flex: 1 1 280px;
}

.iq-page .bottom-actions {
    margin-top: 2rem;
}

.iq-page .floating-top-btn,
.iq-page .floating-resume-btn {
    left: auto;
    right: max(1rem, calc((100vw - 1180px) / 2 - 6rem));
    bottom: clamp(1rem, 2vw, 1.5rem);
    z-index: 60;
}

/* --------------------------------------------------------------------------
   CTA
   -------------------------------------------------------------------------- */

.iq-cta {
    position: relative;
    overflow: hidden;
    border-top: 4px solid var(--brand-gold);
    background: var(--gradient-navy);
}

.iq-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(255, 184, 28, 0.14), transparent 58%);
    pointer-events: none;
}

.iq-cta .container {
    position: relative;
}

.iq-cta .section-title {
    margin-top: 0.55rem;
    color: #fff;
}

.iq-cta__copy {
    max-width: 590px;
    margin: 1rem auto 2rem;
    color: rgba(255, 255, 255, 0.72);
}

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

@media (max-width: 991px) {
    .iq-hero__inner {
        grid-template-columns: 1fr;
    }

    .iq-hero__visual {
        min-height: 300px;
        max-width: 420px;
        width: 100%;
        margin: 0 auto;
    }

    .iq-hero__score {
        width: min(100%, 290px);
    }
}

@media (max-width: 768px) {
    .iq-hero {
        padding-top: 8rem;
        padding-bottom: 4rem;
    }

    .iq-hero h1 {
        font-size: clamp(2.35rem, 10vw, 3.4rem);
    }

    .iq-test-shell {
        padding: 0.9rem;
        border-radius: 24px;
    }

    .iq-test-shell__intro {
        align-items: flex-start;
        padding-bottom: 1rem;
    }

    .iq-test-shell__status {
        font-size: 0.72rem;
    }

    .iq-page .iq-top-bar {
        top: 0.75rem;
        border-radius: 18px;
    }

    .iq-page .floating-top-btn,
    .iq-page .floating-resume-btn {
        right: 1rem;
        bottom: 1rem;
    }
}

@media (max-width: 600px) {
    .iq-hero {
        padding: 7rem 0 3.5rem;
    }

    .iq-hero__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .iq-hero__actions .btn {
        width: 100%;
    }

    .iq-hero__visual {
        min-height: 245px;
    }

    .iq-hero__score {
        width: min(100%, 240px);
    }

    .iq-hero__score strong {
        font-size: 4.2rem;
    }

    .iq-test-shell {
        padding: 0.7rem;
        border-radius: 20px;
    }

    .iq-test-shell__intro {
        padding: 0.35rem 0.25rem 0.9rem;
    }

    .iq-page .iq-widget {
        padding: 0;
    }

    .iq-page .iq-top-bar {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .iq-page .iq-score-strip {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .iq-page .score-pill {
        min-width: 0;
    }

    .iq-page .iq-score-strip .btn-calc-iq,
    .iq-page .iq-score-strip .btn-reset {
        grid-column: 1 / -1;
        width: 100%;
    }

    .iq-page .main-mode-switcher {
        display: flex;
        width: 100%;
        border-radius: 18px;
    }

    .iq-page .mode-switch-tab {
        flex: 1;
        padding: 0.6rem 0.6rem;
        font-size: 0.78rem;
        line-height: 1.3;
    }

    .iq-page .q-card {
        padding: 1rem;
        border-radius: 16px;
    }

    .iq-page .q-text {
        font-size: 1.02rem;
    }

    .iq-page .q-options {
        grid-template-columns: 1fr;
    }

    .iq-page .group-info-bar h2 {
        font-size: 1.15rem;
    }

    .iq-page .reading-search-wrap {
        width: 100%;
        flex-basis: 100%;
    }

    .iq-page .bottom-actions .btn-calc-iq,
    .iq-page .bottom-actions .btn-scroll-top {
        width: 100%;
    }
}

@media (max-width: 380px) {
    .iq-page .iq-score-strip {
        grid-template-columns: 1fr;
    }

    .iq-page .iq-score-strip .btn-calc-iq,
    .iq-page .iq-score-strip .btn-reset {
        grid-column: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .iq-hero__score::before {
        animation: none;
    }

    .iq-page .q-card,
    .iq-page .opt-btn,
    .iq-page .cat-tab-btn,
    .iq-page .mode-switch-tab,
    .iq-page .floating-top-btn,
    .iq-page .floating-resume-btn {
        transition: none !important;
    }
}
