/*
 * /school-of-education-survey (Figma: Phase 1 Ideation, node 22570:1011).
 * Builds on the shared classes from masters.css: heroSection, go-HeroTitle,
 * go-HeroSubtitle, go-HighlightHeading, textHighlight, btnWhite, btnBlack, arrowWrap.
 * Everything is scoped to .eduSurveyPage so nothing leaks into other pages.
 */

.eduSurveyPage {
    --edu-gradient: linear-gradient(-80deg, #F7D344 9.5%, #E38330 104.8%);

    .container {
        max-width: 1240px;
        width: 100%;
        margin: 0 auto;
        padding: 0;
        position: relative;
    }

    ul,
    ol {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .eduDark {
        color: var(--black);
    }

    .eduGradientNum {
        font: 24px/1.2 'go-semibold';
        background: var(--edu-gradient);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        flex-shrink: 0;
        max-width: fit-content;
    }

    .arrowWrap {
        display: inline-block;
    }

    /* ---------- Hero ---------- */
    /* The hero stays pinned while the page scrolls; every section after it sits
       higher (z-index 10, opaque background) and slides up over it. */
    .heroSection {
        position: sticky;
        top: 0;
        z-index: 0;
        height: 800px;
        max-height: 100vh;
        min-height: 100vh;
        line-height: normal;
        overflow: hidden;
        background: #090909;

        &::after {
            content: "";
            position: absolute;
            inset: 0;
            background: linear-gradient(180deg, rgba(9, 9, 9, 0.41) 0%, rgba(9, 9, 9, 0.26) 45%, rgba(9, 9, 9, 0.71) 100%);
            z-index: 1;
        }

        .heroSectionImg {
            position: absolute;
            inset: 0;

            img {
                width: 100%;
                height: 100%;
                object-fit: cover;
            }
        }

        .heroSectionContent {
            position: absolute;
            left: 50%;
            bottom: 60px;
            transform: translateX(-50%);
            width: 100%;
            max-width: 1240px;
            z-index: 2;
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .go-HeroSubtitle {
            font-size: 30px;
            line-height: 1.2;
            color: var(--white);
            margin: 0;
        }

        .heroSectionBtnWrap {
            display: flex;
            padding-top: 16px;
        }
    }

    /* Sections after the hero scroll over it */
    .eduIntro,
    .eduRoles,
    .eduHow,
    .eduNext,
    .eduFinal {
        position: relative;
        z-index: 10;
    }

    /* ---------- Survey intro ---------- */
    .eduIntro {

        background: var(--white);
        border-radius: 24px 24px 0 0;
        padding: 60px 0;
    }

    .eduIntroWrap {
        display: flex;
        gap: 120px;
        align-items: flex-start;
    }

    .eduIntroCopy {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 28px;
        color: var(--grey15);
    }

    .eduIntroLead {
        font: 24px/1.2 'go-regular';
    }

    .eduIntroText {
        font: 20px/1.5 'go-regular';
    }

    .eduSurveyCard {
        width: 480px;
        flex-shrink: 0;
        background: var(--white3);
        border: 1px solid var(--grey4);
        border-radius: 12px;
        overflow: hidden;
    }

    .eduGradientLine {
        height: 4px;
        background: linear-gradient(90deg, #39B6D8 0%, #F7D344 47%, #E38330 100%);
    }

    .eduSurveyCardInner {
        padding: 32px;
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .eduSurveyCardTitle {
        font: 24px/1.2 'go-regular';
        color: var(--black);
        margin-bottom: 6px;
    }

    .eduSurveyCardSub,
    .eduDetailDesc {
        font: 14px/1.5 'go-regular';
        color: var(--grey15);
    }

    .eduDetail {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 14px 0;
        border-top: 1px solid var(--grey4);
    }

    .eduDetailIcon {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
        border-radius: 20px;
        background: var(--grey16);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .eduDetailText {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .eduDetailTitle {
        font: 16px/1.2 'go-semibold';
        color: var(--black);
    }

    .eduFullBtn {
        width: 100%;
    }

    .eduSurveyCardNote {
        font: 13px/1.5 'go-regular';
        color: var(--grey15);
        text-align: center;
    }

    /* ---------- Shared section head ---------- */
    .eduHead {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 24px;
    }

    .eduHeadText {
        width: 420px;
        font: 16px/1.5 'go-regular';
        color: var(--grey15);
    }

    /* ---------- Roles ---------- */
    .eduRoles {
        position: relative;
        overflow: hidden;
        background: var(--white3);
        padding: 60px 0;

        .container {
            display: flex;
            flex-direction: column;
            gap: 32px;
        }
    }

    .eduSwoosh {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(calc(-50% + 19px), calc(-50% + 24px));
        pointer-events: none;
    }

    /* Swiper container (.swiper); slide widths and gaps come from the Swiper init in the page */
    .eduRoleCards {
        width: 100%;

        .swiper-wrapper {
            align-items: stretch;
        }

        /* !important only to beat the site-wide !important pagination rules in
           mains.css (width: 10%, grey bullets) and responsives.css (30px active bullet) */
        .swiper-pagination {
            display: flex;
            justify-content: center;
            gap: 8px;
            width: 100% !important;
            margin-top: 24px;

            /* Swiper adds this when every card fits (desktop) */
            &.swiper-pagination-lock {
                display: none;
            }
        }

        .swiper-pagination-bullet {
            width: 8px;
            height: 8px;
            margin: 0 !important;
            background: var(--grey18) !important;
            opacity: 1;
            border-radius: 60px !important;
            transition: all 0.3s ease !important;
        }

        .swiper-pagination-bullet-active {
            width: 40px !important;
            background: var(--grey10) !important;
        }
    }

    /* height: auto overrides Swiper's 100% so every card matches the tallest one */
    .eduRoleCard {
        height: auto;
        background: var(--white);
        border: 1px solid var(--grey4);
        border-radius: 12px;
        padding: 32px;
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .eduRoleTitle {
        font: 24px/1.2 'go-regular';
        color: var(--black);
        text-transform: capitalize;
    }

    .eduRoleText {
        font: 16px/1.5 'go-regular';
        color: var(--grey15);
    }

    .eduTags {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;

        li {
            font: 13px/1.5 'go-regular';
            color: var(--grey3);
            border: 1px solid var(--grey18);
            border-radius: 999px;
            padding: 6px 12px;
        }
    }

    /* ---------- How it works ---------- */
    .eduHow {
        background: var(--white);
        padding: 60px 0;
    }

    .eduHowWrap {
        display: flex;
        align-items: center;
        gap: 96px;
    }

    .eduHowPhoto {
        width: 600px;
        height: 472px;
        flex-shrink: 0;

        img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 12px;
        }
    }

    .eduHowCopy {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 40px;
    }

    .eduStep {
        display: flex;
        gap: 24px;
        align-items: flex-start;
        padding: 24px 0;
        border-top: 1px solid var(--grey4);
    }

    .eduStepText {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .eduStepTitle {
        font: 20px/1.2 'go-regular';
        color: var(--black);
    }

    .eduStepDesc {
        font: 16px/1.5 'go-regular';
        color: var(--grey15);
    }

    /* ---------- What happens next ---------- */
    .eduNext {
        padding: 60px 0;
        background:
            linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)),
            linear-gradient(150deg, #39B6D8 11%, #F7D344 47.7%, #E38330 89%);

        .container {
            display: flex;
            flex-direction: column;
            gap: 40px;
        }
    }

    .eduBadge {
        font: 12px/1.2 'go-regular';
        color: #000;
        background: rgba(255, 255, 255, 0.5);
        border-radius: 999px;
        padding: 8px 16px;
        text-transform: capitalize;
        white-space: nowrap;
    }

    .eduNextSteps {
        display: flex;
        gap: 24px;

        li {
            flex: 1;
            min-width: 0;
            border-top: 1px solid var(--black);
            padding-top: 20px;
            display: flex;
            flex-direction: column;
            gap: 16px;
            color: var(--black);
        }
    }

    .eduNextNum {
        font: 24px/1.2 'go-semibold';
    }

    .eduNextText {
        font: 18px/1.2 'go-regular';
    }

    /* ---------- Final CTA ---------- */
    .eduFinal {
        background: var(--black);
        padding: 60px 0;
    }

    .eduFinalCard {
        display: flex;
        align-items: center;
        height: 440px;
        padding: 12px;
        background: var(--grey17);
        border: 1px solid var(--black5);
        border-radius: 12px;
        overflow: hidden;
    }

    .eduFinalCopy {
        width: 640px;
        flex-shrink: 0;
        padding: 40px;
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .eduFinalText {
        font: 16px/1.5 'go-regular';
        color: var(--grey10);
    }

    .eduFinalActions {
        display: flex;
        padding-top: 12px;
    }

    .eduFinalPhotos {
        flex: 1;
        min-width: 0;
        height: 100%;
        display: flex;
        gap: 12px;

        img {
            width: 100%;
            height: 100%;
            min-height: 0;
            object-fit: cover;
            border-radius: 8px;
        }
    }

    .eduFinalPhotoTall {
        flex: 1;
        min-width: 0;
    }

    .eduFinalStack {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 12px;

        img {
            flex: 1;
        }
    }
}

/* ---------- Tablet ---------- */
@media (max-width: 1280px) {
    .eduSurveyPage {
        .container,
        .heroSection .heroSectionContent {
            padding: 0 40px;
        }

        .eduIntroWrap {
            gap: 48px;
        }

        .eduHowWrap {
            gap: 48px;
        }

        .eduHowPhoto {
            width: 50%;
        }

        .eduFinalCopy {
            width: 50%;
        }
    }
}

/* ---------- Mobile (Figma: Mobile 390, node 22570:1333) ---------- */
@media (max-width: 768px) {
    .eduSurveyPage {
        .container,
        .heroSection .heroSectionContent {
            padding: 0 16px;
        }

        /* Section headings: 24px (masters.css drops go-HighlightHeading to 22px on mobile) */
        .go-HighlightHeading {
            font-size: 24px;
        }

        /* Hero */
        .heroSection {
            height: 100vh;
            min-height: 100vh;

            &::after {
                background: linear-gradient(180deg, rgba(9, 9, 9, 0.6) 0%, rgba(9, 9, 9, 0.3) 40%, rgba(9, 9, 9, 0.95) 100%);
            }

            .heroSectionContent {
                bottom: 60px;
                gap: 8px;
            }

            .go-HeroSubtitle {
                font-size: 22px;
                color: var(--grey10);

                .font-medium {
                    color: var(--white);
                }
            }

            .heroSectionBtnWrap {
                padding-top: 12px;
            }
        }

        .eduIntro,
        .eduRoles,
        .eduHow,
        .eduNext,
        .eduFinal {
            padding: 60px 0;
        }

        .eduIntroWrap,
        .eduHowWrap,
        .eduNextSteps,
        .eduFinalCard {
            flex-direction: column;
        }

        .eduHead {
            flex-direction: column;
            align-items: flex-start;
            gap: 12px;
        }

        .eduHeadText,
        .eduSurveyCard,
        .eduHowPhoto,
        .eduFinalCopy {
            width: 100%;
        }

        /* Survey intro */
        .eduIntro {
            border-radius: 20px 20px 0 0;
        }

        .eduIntroWrap {
            gap: 32px;
        }

        .eduIntroCopy {
            gap: 20px;
        }

        .eduIntroLead {
            font-size: 18px;
        }

        .eduIntroText {
            font-size: 14px;
        }

        .eduSurveyCardInner {
            padding: 24px 20px;
        }

        .eduSurveyCardTitle {
            font-size: 18px;
        }

        .eduSurveyCardSub,
        .eduDetailDesc {
            font-size: 13px;
        }

        .eduDetailTitle {
            font-size: 15px;
        }

        .eduSurveyCardNote {
            font-size: 12px;
        }

        /* Card and final-CTA buttons: 15px label on mobile (hero button stays 16px) */
        .eduFullBtn,
        .eduFinalActions a {
            font-size: 15px;
        }

        /* Roles: fixed 320px cards (slidesPerView "auto" in the Swiper init) */
        .eduRoles .container {
            gap: 24px;
        }

        .eduSwoosh {
            transform: translate(calc(-50% + 132px), calc(-50% + 79px));
        }

        .eduHeadText {
            font-size: 14px;
        }

        .eduRoleCard {
            width: 320px;
            padding: 24px;
            gap: 12px;

            .eduGradientNum {
                font-size: 20px;
            }
        }

        .eduRoleTitle {
            font-size: 18px;
        }

        .eduRoleText {
            font-size: 13px;
        }

        .eduTags {
            padding-top: 8px;

            li {
                font-size: 12px;
            }
        }

        .eduRoleCards .swiper-pagination {
            margin-top: 16px;
        }

        /* How it works */
        .eduHowWrap {
            gap: 32px;
        }

        .eduHowPhoto {
            height: 261px;
        }

        .eduHowCopy {
            gap: 24px;
        }

        .eduStep {
            gap: 16px;
            padding: 16px;

            /* Same gradient as desktop, at 20px */
            .eduGradientNum {
                font-size: 20px;
            }
        }

        .eduStepTitle {
            font-size: 18px;
        }

        .eduStepDesc {
            font-size: 13px;
        }

        /* What happens next */
        .eduNext {
            background:
                linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)),
                linear-gradient(104deg, #39B6D8 11%, #F7D344 47.7%, #E38330 89%);

            .container {
                gap: 28px;
            }

            .eduHead {
                gap: 14px;
            }
        }

        .eduNextSteps {
            gap: 20px;

            li {
                padding: 16px;
                gap: 10px;
            }
        }

        .eduNextNum {
            font-size: 20px;
        }

        /* Final CTA: photos on top, then copy */
        .eduFinalCard {
            height: auto;
            gap: 0;
            padding: 8px;
            border: none;
            border-radius: 16px;
        }

        /* flex: none so the fixed height wins over the desktop flex: 1 in the column layout */
        .eduFinalPhotos {
            order: -1;
            flex: none;
            width: 100%;
            height: 260px;
            gap: 8px;
        }

        .eduFinalStack {
            gap: 8px;
        }

        .eduFinalCopy {
            padding: 16px;
            gap: 18px;
        }

        .eduFinalText {
            font-size: 14px;
        }

        .eduFinalActions {
            padding-top: 6px;

            a {
                width: 100%;
            }
        }
    }
}

/* "Start the survey" popup: name, email, mobile before the survey (StartSurveyPopup.jsx) */
body.eduStartLock {
    overflow: hidden;
}

.eduSurveyPage {
    .eduStartModal {
        position: fixed;
        inset: 0;
        z-index: 10001;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 16px;

        &[hidden] {
            display: none;
        }
    }

    .eduStartOverlay {
        position: absolute;
        inset: 0;
        background: rgba(9, 9, 9, 0.6);
    }

    .eduStartDialog {
        position: relative;
        width: 100%;
        max-width: 520px;
        overflow: visible;
        padding: 40px 32px 32px;
        background: var(--white);
        border-radius: 16px;
        box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
    }

    .eduStartClose {
        position: absolute;
        top: 16px;
        right: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: transparent;
        border: 1px solid var(--grey4);
        border-radius: 50%;
        cursor: pointer;

        &:hover {
            border-color: var(--black);
        }
    }

    .eduStartTitle {
        font: 28px/1.2 'go-semibold';
        color: var(--black);
    }

    .eduStartText {
        margin-top: 8px;
        font: 16px/1.5 'go-regular';
        color: var(--grey);
    }

    .eduStartForm {
        display: flex;
        flex-direction: column;
        gap: 18px;
        margin-top: 28px;
    }

    /* The popup shows either the details form or the "Is this you?" view. */
    .eduStartForm[hidden],
    .eduStartSaved[hidden] {
        display: none;
    }

    .eduStartSaved {
        display: flex;
        flex-direction: column;
        gap: 14px;
        margin-top: 24px;
    }

    .eduStartSavedCard {
        border: 1px solid #E4E4E4;
        border-radius: 12px;
        background: #FAFAF8;
        overflow: hidden;
    }

    .eduStartSavedHead {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 18px 20px;
    }

    .eduStartAvatar {
        display: flex;
        flex: 0 0 48px;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: var(--edu-gradient);
        font: 17px/1 'go-semibold';
        color: var(--black);
        letter-spacing: 0.02em;
    }

    .eduStartSavedWho {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
    }

    .eduStartSavedName {
        font: 18px/1.3 'go-semibold';
        color: var(--black);
        overflow-wrap: anywhere;
    }

    .eduStartSavedNote {
        font: 13px/1.4 'go-regular';
        color: var(--grey);
    }

    .eduStartSavedList {
        margin: 0;
        padding: 4px 20px;
        border-top: 1px solid #E4E4E4;
        background: var(--white);
    }

    .eduStartSavedRow {
        display: flex;
        justify-content: space-between;
        gap: 16px;
        padding: 12px 0;
        font: 14px/1.5 'go-regular';

        & + & {
            border-top: 1px solid #EFEFEF;
        }

        dt {
            flex: 0 0 auto;
            color: var(--grey);
        }

        dd {
            min-width: 0;
            margin: 0;
            font-family: 'go-medium';
            color: var(--black);
            text-align: right;
            overflow-wrap: anywhere;
        }
    }

    .eduStartSwitch {
        align-self: center;
        padding: 4px 0;
        border: 0;
        background: none;
        font: 14px/1.5 'go-medium';
        color: var(--grey);
        cursor: pointer;

        &:hover {
            color: var(--black);
            text-decoration: underline;
            text-underline-offset: 3px;
        }
    }

    .eduStartField {
        display: flex;
        flex-direction: column;
        gap: 8px;

        &.isInvalid > .eduStartInput,
        &.isInvalid .eduStartPhone > input[type="tel"] {
            border-color: #DF2935;
        }
    }

    .eduStartLabel {
        font: 14px/1.5 'go-semibold';
        color: var(--black);
    }

    .eduStartReq {
        color: #DF2935;
    }

    .eduStartError,
    .eduStartFormError {
        font: 13px/1.5 'go-regular';
        color: #DF2935;

        &:empty {
            display: none;
        }
    }

    .eduStartInput {
        width: 100%;
        min-width: 0;
        padding: 12px 16px;
        background: var(--white);
        border: 1px solid var(--grey4);
        border-radius: 8px;
        font: 16px/1.5 'go-regular';
        color: var(--black);

        &::placeholder {
            color: var(--grey);
        }

        &:focus {
            outline: none;
            border-color: var(--black);
        }
    }

    .eduStartPhone {
        position: relative;
        display: flex;
        gap: 8px;

        > input {
            flex: 1;
            min-width: 0;
        }
    }

    .eduStartCountryWrap {
        flex: 0 0 128px;
    }

    .eduStartCountry {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        height: 100%;
        white-space: nowrap;
        cursor: pointer;

        &:hover {
            border-color: var(--grey10);
        }

        &.isOpen,
        &:focus-visible {
            border-color: var(--black);
            outline: none;
        }

        svg {
            flex-shrink: 0;
            transition: transform 0.2s ease;
        }

        &.isOpen svg {
            transform: rotate(180deg);
        }
    }

    /* Floats over the dialog (and past its bottom edge) under the number row */
    .eduStartMenu {
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        right: 0;
        z-index: 5;
        display: flex;
        flex-direction: column;
        gap: 6px;
        padding: 6px;
        background: var(--white);
        border: 1px solid var(--grey4);
        border-radius: 8px;
        box-shadow: 0 8px 12px rgba(0, 0, 0, 0.08);

        &[hidden] {
            display: none;
        }
    }

    .eduStartList {
        display: flex;
        flex-direction: column;
        gap: 2px;
        max-height: 240px;
        overflow-y: auto;

        button {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            width: 100%;
            padding: 10px 12px;
            background: transparent;
            border: none;
            border-radius: 4px;
            font: 16px/1.5 'go-regular';
            color: var(--black);
            text-align: left;
            cursor: pointer;

            &:hover,
            &:focus-visible {
                background: var(--grey16);
                outline: none;
            }

            &.isSelected {
                background: var(--grey16);
                font-family: 'go-semibold';
            }
        }
    }

    .eduStartCountryName {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .eduStartCountryCode {
        flex-shrink: 0;
        color: var(--grey);
    }

    .eduStartEmpty {
        padding: 10px 12px;
        font: 14px/1.5 'go-regular';
        color: var(--grey);
    }

    .eduStartSubmit {
        justify-content: center;
        width: 100%;
        margin-top: 6px;
    }
}

@media (max-width: 768px) {
    .eduSurveyPage {
        .eduStartModal {
            align-items: flex-end;
            padding: 0;
        }

        .eduStartDialog {
            max-width: none;
            padding: 32px 20px 24px;
            border-radius: 16px 16px 0 0;
        }

        .eduStartTitle {
            font-size: 22px;
        }

        /* The sheet sits at the bottom of the screen: open the country list upwards */
        .eduStartMenu {
            top: auto;
            bottom: calc(100% + 6px);
        }

        .eduStartList {
            max-height: 200px;
        }

        .eduStartText,
        .eduStartInput,
        .eduStartList button {
            font-size: 14px;
        }
    }
}
