/* =====================================================================
   gw-modals.css: ONE shared skin for every popup on the public site (20 Nov 2026).
   Loaded once from the public layouts (main + new_main), at the very end of <body>, so it comes
   after every page / section stylesheet. Selectors are id based and prefixed with "html body" so
   they also beat section CSS that arrives later (home section 3 is injected by AJAX).
   Colours: only gateway-theme.css tokens. Hooks used by JS (ids / classes / data-*) are untouched.

   Modals covered:
     custom overlays : #gwStudentModal (Get Free Counselling), #gwFrModal (franchise), #agModal (partner lead),
                       #heOtpBackdrop (counselling OTP), #gwAboutModal (navy portal: edge + close only)
     bootstrap       : #loginModal, #generalQueryModal, #storymodal, #storyvideomodal,
                       #playVideoModal, #playVideoModalforBooking, #playVideoModalforcounsultant, #playVideoModalforrefer
   NOT covered on purpose: #popupBannerModal (promo banner has its own design).
   ===================================================================== */

:root {
    --gwm-radius: 24px;
    --gwm-sheet-radius: 22px;
    --gwm-enter: 200ms;
    --gwm-exit: 150ms;
    --gwm-ease-out: cubic-bezier(.2, .8, .2, 1);
    --gwm-ease-in: cubic-bezier(.4, 0, 1, 1);
    --gwm-edge: 1.5px;
    --gwm-shadow: 0 0 36px rgba(var(--gw-gold-rgb), .26), 0 30px 80px rgba(var(--gw-navy-rgb), .45);
    --gwm-input-border: rgba(var(--gw-navy-rgb), .15);
    --gwm-placeholder: rgba(var(--gw-slate-rgb), .6);
}

/* ---------------------------------------------------------------------
   1. Backdrops: navy ~.6 with a slight blur
   --------------------------------------------------------------------- */
html body :is(#gwStudentModal, #gwFrModal, #agModal, #heOtpBackdrop) {
    background: rgba(var(--gw-navy-rgb), .6);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
/* Bootstrap backdrop, only while one of OUR modals is open (the promo banner keeps its own). */
body:has(:is(#loginModal, #generalQueryModal, #storymodal, #storyvideomodal, #playVideoModal, #playVideoModalforBooking, #playVideoModalforcounsultant, #playVideoModalforrefer).show) .modal-backdrop.show {
    opacity: 1;
    background-color: rgba(var(--gw-navy-rgb), .6);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

/* ---------------------------------------------------------------------
   2. The card: one white surface, thin shiny gold edge (gradient border), gold strip on top,
      soft gold glow + deep navy shadow. No inset double frame.
   --------------------------------------------------------------------- */
html body #gwStudentModal .gw-hm-dialog,
html body #gwFrModal .gw-hm-dialog,
html body #agModal .ag-modal-dialog,
html body #heOtpBackdrop .he-otp-modal,
html body :is(#loginModal, #generalQueryModal, #storymodal, #storyvideomodal, #playVideoModal, #playVideoModalforBooking, #playVideoModalforcounsultant, #playVideoModalforrefer) .modal-content {
    position: relative;
    border: var(--gwm-edge) solid transparent !important;
    border-radius: var(--gwm-radius);
    background:
        var(--gw-gold-shine) top center / 100% 4px no-repeat padding-box,
        linear-gradient(var(--gw-white), var(--gw-white)) padding-box,
        var(--gw-gold-shine) border-box;
    box-shadow: var(--gwm-shadow);
    color: var(--gw-navy);
    font-family: var(--gw-font);
}

/* ---- Remove the old thick gold outer frame of the counselling form ----
   It came from new_home.css: .banner-form-border { gold 16% fill + 10px padding + 2px gold border + gold ring }
   with a white .banner-form-bg box inset inside it. Both layers become transparent: the dialog is the card. */
html body #gwStudentModal .gw-hm-dialog { width: min(500px, 100%); }
html body #gwStudentModal .form-height { margin: 0; min-height: 0; padding: 0; }
html body #gwStudentModal .banner-form-border {
    margin: 0;
    padding: 0;
    max-width: none;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
html body #gwStudentModal .banner-form-bg {
    padding: 34px 30px 30px;
    background: transparent;
    border-radius: 0;
}

/* ---- Franchise popup: the inner .fr-shell had its own 2px gold border + gold ring ---- */
html body #gwFrModal .gw-fr-card.fr-shell {
    max-width: none;
    margin: 0;
    padding: 34px 30px 28px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

/* ---- Partner lead popup ---- */
html body #agModal .ag-modal-dialog { padding: 32px 30px 28px; overflow-x: hidden; }

/* ---- OTP popup ---- */
html body #heOtpBackdrop .he-otp-modal { max-width: 400px; padding: 34px 28px 26px; }

/* ---- Bootstrap modals ---- */
html body #loginModal .modal-content { max-width: 440px; overflow: hidden; }
html body #loginModal .modal-header { padding: 34px 28px 4px; }
html body #loginModal .modal-body { padding: 0 28px 28px; }
html body #generalQueryModal .modal-content { width: 100% !important; max-width: 460px; white-space: normal !important; }
html body #generalQueryModal .modal-header { padding: 30px 28px 4px; align-items: flex-start; }
html body #generalQueryModal .modal-body { padding: 16px 28px 8px; }
html body #generalQueryModal .modal-footer { padding: 8px 28px 28px; border: 0; }
html body #generalQueryModal .modal-footer > * { margin: 0; }
html body #generalQueryModal .form-group { margin-bottom: 14px; }
/* Video popups: keep the player, give it the same card + close */
html body :is(#playVideoModal, #playVideoModalforBooking, #playVideoModalforcounsultant, #playVideoModalforrefer) .modal-content { overflow: hidden; padding-bottom: 20px !important; }
html body :is(#playVideoModal, #playVideoModalforBooking, #playVideoModalforcounsultant, #playVideoModalforrefer) video { display: block; }
html body #storyvideomodal .modal-content { overflow: hidden; }
html body #storyvideomodal .modal-header,
html body #storyvideomodal .modal-body { border-radius: 0 !important; background: transparent !important; }
html body #storyvideomodal .modal-header { padding: 14px 14px 0; }
html body #storyvideomodal .modal-body { padding: 10px 20px 20px; }

/* ---------------------------------------------------------------------
   3. Header: title 24px 700 navy (explicit fill: the site has gradient-text headings),
      sub line 15px slate
   --------------------------------------------------------------------- */
html body #gwStudentModal .form-title,
html body #gwFrModal .fr-formtop h3,
html body #agModal .ag-modal-head h2,
html body #heOtpBackdrop .he-otp-title,
html body #loginModal .modal-header h2,
html body #generalQueryModal #generalQueryModalLabel h6 {
    margin: 0 0 6px;
    padding: 0;
    font-family: var(--gw-font);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.015em;
    text-transform: none;
    text-align: left;
    background: none;
    color: var(--gw-navy);
    -webkit-text-fill-color: var(--gw-navy);
}
html body #gwStudentModal .form-title { padding-right: 48px; }
html body #heOtpBackdrop .he-otp-title { font-size: 22px; text-align: center; }
html body #loginModal .modal-header h2 { width: auto; text-align: center; }

html body #gwStudentModal .form-sub-title,
html body #gwFrModal .fr-formtop p,
html body #agModal .ag-modal-desc,
html body #heOtpBackdrop .he-otp-sub,
html body #loginModal .login-details,
html body #loginModal .signup-modal form > p {
    margin: 0 0 22px;
    font-family: var(--gw-font) !important;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.55;
    color: var(--gw-slate);
    -webkit-text-fill-color: var(--gw-slate);
}
html body #gwFrModal .fr-formtop { margin-bottom: 20px; padding-right: 48px; }
html body #gwFrModal .fr-formtop p { margin: 0; }
html body #heOtpBackdrop .he-otp-sub b { color: var(--gw-navy); }
html body #loginModal .login-details { text-align: center; margin-bottom: 20px; }
html body #storymodal .story-modal-name { font-size: 20px; font-weight: 700; }

/* ---------------------------------------------------------------------
   4. Labels 14px 600 navy; required star in the site's error red (--gw-danger)
   --------------------------------------------------------------------- */
html body #gwStudentModal #homeEnquiryForm label,
html body #gwFrModal .fr-field,
html body #agModal .ag-form .ag-field > span:first-child {
    font-family: var(--gw-font);
    font-size: 14px;
    font-weight: 600;
    color: var(--gw-navy);
}
html body #gwStudentModal .he-req { color: var(--gw-danger); }
html body #gwStudentModal .he-field { margin-bottom: 16px; }

/* ---------------------------------------------------------------------
   5. Inputs: 48px, 12px radius, thin navy border, ice fill; focus = gold border + gold ring.
      background-COLOR only, so select arrows (background-image) survive.
   --------------------------------------------------------------------- */
html body #gwStudentModal .he-input,
html body #gwFrModal .fr-field input,
html body #gwFrModal .fr-field select,
html body #agModal .ag-form input[type=text],
html body #agModal .ag-form input[type=tel],
html body #agModal .ag-form input[type=email],
html body #agModal .ag-form select,
html body #agModal .ag-loc-btn,
html body #heOtpBackdrop .he-otp-input,
html body #loginModal .form-control,
html body #generalQueryModal .form-control {
    height: 48px;
    min-height: 48px;
    border: 1px solid var(--gwm-input-border);
    border-radius: 12px;
    background-color: var(--gw-ice);
    color: var(--gw-navy);
    font-family: var(--gw-font);
    font-size: 15px;
    font-weight: 400;
    box-shadow: none;
    outline: none;
    transition: border-color var(--gwm-exit) ease, box-shadow var(--gwm-exit) ease, background-color var(--gwm-exit) ease;
}
html body #gwStudentModal .he-input,
html body #loginModal .form-control,
html body #generalQueryModal .form-control { padding: 0 14px; }
html body #heOtpBackdrop .he-otp-input { height: 56px; font-size: 24px; font-weight: 700; }

html body #gwStudentModal .he-input::placeholder,
html body #gwFrModal .fr-field input::placeholder,
html body #agModal .ag-form input::placeholder,
html body #heOtpBackdrop .he-otp-input::placeholder,
html body #loginModal .form-control::placeholder,
html body #generalQueryModal .form-control::placeholder { color: var(--gwm-placeholder); opacity: 1; }
html body #agModal .ag-loc-text.is-placeholder { color: var(--gwm-placeholder); }

html body #gwStudentModal .he-input:focus,
html body #gwFrModal .fr-field input:focus,
html body #gwFrModal .fr-field select:focus,
html body #agModal .ag-form input:focus,
html body #agModal .ag-form select:focus,
html body #agModal .ag-loc-btn:focus,
html body #agModal .ag-loc.is-open .ag-loc-btn,
html body #heOtpBackdrop .he-otp-input:focus,
html body #loginModal .form-control:focus,
html body #generalQueryModal .form-control:focus {
    border-color: var(--gw-gold);
    background-color: var(--gw-white);
    box-shadow: 0 0 0 3px rgba(var(--gw-gold-rgb), .3);
    outline: none;
}

/* Error states keep the site's red */
html body #gwStudentModal .he-input.is-invalid,
html body #heOtpBackdrop .he-otp-input.is-invalid,
html body #gwFrModal .fr-field.is-invalid input,
html body #gwFrModal .fr-field.is-invalid select,
html body #agModal .ag-form .ag-invalid input,
html body #agModal .ag-form .ag-invalid select,
html body #agModal .ag-form .ag-invalid .ag-loc-btn {
    border-color: var(--gw-danger);
    box-shadow: 0 0 0 3px rgba(var(--gw-danger-rgb), .12);
}

/* Login / sign-up: icon + input joined as one 48px field */
html body #loginModal .input-group-text {
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--gwm-input-border);
    border-right: 0;
    border-radius: 12px 0 0 12px;
    background-color: var(--gw-ice);
}
html body #loginModal .input-group > .form-control { border-radius: 0 12px 12px 0 !important; }
html body #loginModal .input-group:focus-within .input-group-text { border-color: var(--gw-gold); background-color: var(--gw-white); }
html body #loginModal .input-group .form-control:focus { box-shadow: none; }
html body #loginModal .input-group:focus-within { border-radius: 12px; box-shadow: 0 0 0 3px rgba(var(--gw-gold-rgb), .3); }

/* Consent lines: navy-blue text, never black or grey */
html body #loginModal .consent-wrapper span,
html body #generalQueryModal .consent-wrapper span,
html body #gwFrModal .fr-consent,
html body #agModal .ag-consent span,
html body #loginModal .form-check-label {
    color: var(--gw-slate) !important;
    -webkit-text-fill-color: var(--gw-slate);
    font-size: 13px;
    line-height: 1.5;
}
html body #loginModal :is(.sign-up-text, .resend-otp-text) { color: var(--gw-gold-dark); font-weight: 600; }
html body #heOtpBackdrop .he-otp-link[disabled] { color: var(--gwm-placeholder); }

/* ---------------------------------------------------------------------
   6. Primary button: gold shine, navy text, 52px, full width, glow; hover lifts 1px
   --------------------------------------------------------------------- */
html body #gwStudentModal #homeEnquirySubmit,
html body #heOtpBackdrop #heOtpVerify,
html body #gwFrModal .fr-btn--primary,
html body #agModal .ag-submit,
html body #agModal .ag-modal-done .ag-btn,
html body #loginModal .btn-primary-main,
html body #generalQueryModal :is(.general-query-btn, .general-query-verify-btn) {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 52px;
    height: auto;
    padding: 12px 24px;
    border: 1px solid var(--gw-gold);
    border-radius: 999px;
    background: var(--gw-gold-shine);
    color: var(--gw-navy) !important;
    -webkit-text-fill-color: var(--gw-navy);
    font-family: var(--gw-font);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: .01em;
    box-shadow: var(--gw-gold-glow);
    transform: none;
    transition: transform var(--gwm-exit) var(--gwm-ease-out), box-shadow var(--gwm-exit) var(--gwm-ease-out), filter var(--gwm-exit) ease;
}
/* no navy "wipe" fill inside the modal buttons */
html body #gwStudentModal #homeEnquirySubmit::after,
html body #heOtpBackdrop #heOtpVerify::after,
html body #gwFrModal .fr-btn--primary::after,
html body #agModal .ag-submit::after,
html body #agModal .ag-modal-done .ag-btn::after,
html body #loginModal .btn-primary-main::after,
html body #generalQueryModal :is(.general-query-btn, .general-query-verify-btn)::after { display: none; }

html body #gwStudentModal #homeEnquirySubmit:hover,
html body #heOtpBackdrop #heOtpVerify:hover,
html body #gwFrModal .fr-btn--primary:hover,
html body #agModal .ag-submit:hover,
html body #agModal .ag-modal-done .ag-btn:hover,
html body #loginModal .btn-primary-main:hover,
html body #generalQueryModal :is(.general-query-btn, .general-query-verify-btn):hover {
    transform: translateY(-1px);
    color: var(--gw-navy) !important;
    -webkit-text-fill-color: var(--gw-navy);
    background: var(--gw-gold-shine);
    box-shadow: 0 10px 26px rgba(var(--gw-gold-rgb), .55), inset 0 1px 0 rgba(255, 255, 255, .65), inset 0 -2px 0 rgba(var(--gw-gold-dark-rgb), .25);
    filter: saturate(1.06);
}
html body #gwStudentModal #homeEnquirySubmit:focus-visible,
html body #heOtpBackdrop #heOtpVerify:focus-visible,
html body #gwFrModal .fr-btn--primary:focus-visible,
html body #agModal .ag-submit:focus-visible,
html body #loginModal .btn-primary-main:focus-visible,
html body #generalQueryModal :is(.general-query-btn, .general-query-verify-btn):focus-visible {
    outline: 3px solid var(--gw-navy);
    outline-offset: 3px;
}
html body :is(#gwStudentModal, #heOtpBackdrop, #gwFrModal, #agModal, #loginModal, #generalQueryModal) button[disabled] { transform: none; opacity: .7; cursor: default; }
html body #generalQueryModal .general-query-btn img { width: 16px; height: auto; }
html body #gwFrModal .fr-submitline { margin-top: 18px; }

/* ---------------------------------------------------------------------
   7. Close button: 40px circle, ice, navy x, top-right; hover navy with gold x
   --------------------------------------------------------------------- */
html body #gwStudentModal .gw-hm-close,
html body #gwFrModal .gw-hm-close,
html body #agModal .ag-close,
html body #gwAboutModal .gw-about-close,
html body #storymodal .story-modal-close,
html body #storyvideomodal .btn-close,
html body #loginModal .btn-close,
html body #generalQueryModal .close,
html body :is(#playVideoModal, #playVideoModalforBooking, #playVideoModalforcounsultant, #playVideoModalforrefer) .close {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50%;
    background: var(--gw-ice) !important;
    color: var(--gw-navy) !important;
    opacity: 1;
    font-family: var(--gw-font);
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(var(--gw-navy-rgb), .10);
    cursor: pointer;
    transition: background-color var(--gwm-exit) ease, color var(--gwm-exit) ease, transform var(--gwm-enter) var(--gwm-ease-out);
}
html body #gwStudentModal .gw-hm-close,
html body #gwFrModal .gw-hm-close,
html body #loginModal .btn-close { position: absolute; top: 14px; right: 14px; z-index: 3; margin: 0; }
html body #storymodal .story-modal-close { top: 14px; right: 14px; }
html body #storyvideomodal .btn-close { margin: 0 0 0 auto !important; }
html body #generalQueryModal .close { margin: -12px -12px 0 12px !important; }
html body :is(#playVideoModal, #playVideoModalforBooking, #playVideoModalforcounsultant, #playVideoModalforrefer) .close { margin: 14px 14px 10px 0 !important; }

/* Bootstrap .btn-close draws its x as an SVG background: replace it with a text x that can change colour */
html body #storyvideomodal .btn-close:empty::before,
html body #loginModal .btn-close:empty::before { content: "\00d7"; font-size: 24px; line-height: 1; }
html body :is(#generalQueryModal, #playVideoModal, #playVideoModalforBooking, #playVideoModalforcounsultant, #playVideoModalforrefer) .close span {
    color: inherit !important;
    font-size: 24px !important;
    line-height: 1 !important;
}

html body #gwStudentModal .gw-hm-close:hover,
html body #gwFrModal .gw-hm-close:hover,
html body #agModal .ag-close:hover,
html body #gwAboutModal .gw-about-close:hover,
html body #storymodal .story-modal-close:hover,
html body #storyvideomodal .btn-close:hover,
html body #loginModal .btn-close:hover,
html body #generalQueryModal .close:hover,
html body :is(#playVideoModal, #playVideoModalforBooking, #playVideoModalforcounsultant, #playVideoModalforrefer) .close:hover {
    background: var(--gw-navy) !important;
    color: var(--gw-gold) !important;
}
html body #gwAboutModal .gw-about-close:hover { box-shadow: 0 0 0 1px rgba(var(--gw-gold-rgb), .6); }

html body #gwStudentModal .gw-hm-close:focus-visible,
html body #gwFrModal .gw-hm-close:focus-visible,
html body #agModal .ag-close:focus-visible,
html body #gwAboutModal .gw-about-close:focus-visible,
html body #storymodal .story-modal-close:focus-visible,
html body #storyvideomodal .btn-close:focus-visible,
html body #loginModal .btn-close:focus-visible,
html body #generalQueryModal .close:focus-visible,
html body :is(#playVideoModal, #playVideoModalforBooking, #playVideoModalforcounsultant, #playVideoModalforrefer) .close:focus-visible {
    outline: 3px solid var(--gw-gold);
    outline-offset: 2px;
    box-shadow: none;
}

/* ---------------------------------------------------------------------
   8. "What is Gateway Educonnect?" (navy portal): already a single navy surface with a gold-shine edge.
      Only aligned to the shared radius / edge / glow / close button.
   --------------------------------------------------------------------- */
html body #gwAboutModal .gw-about-dialog {
    border-width: var(--gwm-edge);
    border-radius: var(--gwm-radius);
    box-shadow: 0 0 40px rgba(var(--gw-gold-rgb), .26), 0 40px 100px rgba(0, 0, 0, .45);
}

/* ---------------------------------------------------------------------
   9. Motion: enter 200ms opacity + 8px rise, exit 150ms
   --------------------------------------------------------------------- */
/* .gw-hm (student, franchise) already animates this way in home-hero.css. */
/* Partner + OTP popups are shown with display:none -> flex, so they get an enter animation. */
html body #agModal.is-open { animation: gwmFade var(--gwm-enter) var(--gwm-ease-out) both; }
html body #agModal.is-open .ag-modal-dialog { animation: gwmRise var(--gwm-enter) var(--gwm-ease-out) both; }
html body #heOtpBackdrop[style*="flex"] { animation: gwmFade var(--gwm-enter) var(--gwm-ease-out) both; }
html body #heOtpBackdrop[style*="flex"] .he-otp-modal { animation: gwmRise var(--gwm-enter) var(--gwm-ease-out) both; }
@keyframes gwmFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gwmRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Bootstrap modals: replace the 300ms slide-from-top with the shared timing. */
html body :is(#loginModal, #generalQueryModal, #storymodal, #storyvideomodal, #playVideoModal, #playVideoModalforBooking, #playVideoModalforcounsultant, #playVideoModalforrefer).fade {
    transition: opacity var(--gwm-exit) var(--gwm-ease-in);
}
html body :is(#loginModal, #generalQueryModal, #storymodal, #storyvideomodal, #playVideoModal, #playVideoModalforBooking, #playVideoModalforcounsultant, #playVideoModalforrefer).fade.show {
    transition: opacity var(--gwm-enter) var(--gwm-ease-out);
}
html body :is(#loginModal, #generalQueryModal, #storymodal, #storyvideomodal, #playVideoModal, #playVideoModalforBooking, #playVideoModalforcounsultant, #playVideoModalforrefer).fade .modal-dialog {
    transform: translateY(8px);
    transition: transform var(--gwm-exit) var(--gwm-ease-in);
}
html body :is(#loginModal, #generalQueryModal, #storymodal, #storyvideomodal, #playVideoModal, #playVideoModalforBooking, #playVideoModalforcounsultant, #playVideoModalforrefer).fade.show .modal-dialog {
    transform: none;
    transition: transform var(--gwm-enter) var(--gwm-ease-out);
}

/* ---------------------------------------------------------------------
   10. Phones (< 576px): bottom sheet, top radius 22px, max 90vh, content scrolls inside
   --------------------------------------------------------------------- */
@media (max-width: 575.98px) {
    /* custom overlays */
    html body :is(#gwStudentModal, #gwFrModal, #agModal, #heOtpBackdrop) { padding: 0; align-items: flex-end; }
    html body #gwStudentModal .gw-hm-dialog,
    html body #gwFrModal .gw-hm-dialog,
    html body #agModal .ag-modal-dialog,
    html body #heOtpBackdrop .he-otp-modal {
        width: 100%;
        max-width: none;
        max-height: 90vh;
        max-height: 90dvh;
        overflow-y: auto;
        overscroll-behavior: contain;
        border-bottom-width: 0 !important;
        border-radius: var(--gwm-sheet-radius) var(--gwm-sheet-radius) 0 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    html body #gwStudentModal .banner-form-bg { padding: 28px 20px 24px; }
    html body #gwFrModal .gw-fr-card.fr-shell { padding: 28px 20px 22px; }
    html body #agModal .ag-modal-dialog { padding: 28px 20px calc(22px + env(safe-area-inset-bottom, 0px)); }
    html body #heOtpBackdrop .he-otp-modal { padding: 30px 20px calc(22px + env(safe-area-inset-bottom, 0px)); }

    /* bootstrap modals */
    html body :is(#loginModal, #generalQueryModal, #storymodal, #storyvideomodal, #playVideoModal, #playVideoModalforBooking, #playVideoModalforcounsultant, #playVideoModalforrefer) .modal-dialog {
        display: flex;
        align-items: flex-end;
        width: 100%;
        max-width: none;
        min-height: 100%;
        height: auto;
        margin: 0 !important;
    }
    html body :is(#loginModal, #generalQueryModal, #storymodal, #storyvideomodal, #playVideoModal, #playVideoModalforBooking, #playVideoModalforcounsultant, #playVideoModalforrefer) .modal-content {
        width: 100% !important;
        max-width: none;
        max-height: 90vh;
        max-height: 90dvh;
        margin: 0 !important;
        overflow-y: auto;
        overscroll-behavior: contain;
        border-bottom-width: 0 !important;
        border-radius: var(--gwm-sheet-radius) var(--gwm-sheet-radius) 0 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    html body #playVideoModal { top: 0; }
    html body #loginModal .modal-header { padding: 30px 20px 4px; }
    html body #loginModal .modal-body { padding: 0 20px 22px; }
    html body #generalQueryModal .modal-header { padding: 28px 20px 4px; }
    html body #generalQueryModal .modal-body { padding: 14px 20px 6px; }
    html body #generalQueryModal .modal-footer { padding: 8px 20px 22px; }

    html body #gwStudentModal .form-title,
    html body #gwFrModal .fr-formtop h3,
    html body #agModal .ag-modal-head h2,
    html body #loginModal .modal-header h2,
    html body #generalQueryModal #generalQueryModalLabel h6 { font-size: 22px; }

    /* 16px inputs: iOS does not zoom the page on focus */
    html body #gwStudentModal .he-input,
    html body #gwFrModal .fr-field input,
    html body #gwFrModal .fr-field select,
    html body #agModal .ag-form input[type=text],
    html body #agModal .ag-form input[type=tel],
    html body #agModal .ag-form input[type=email],
    html body #agModal .ag-form select,
    html body #loginModal .form-control,
    html body #generalQueryModal .form-control { font-size: 16px; }

    html body #gwAboutModal .gw-about-dialog { border-radius: var(--gwm-sheet-radius) var(--gwm-sheet-radius) 0 0; }
    html body #gwAboutModal .gw-about-close { background: var(--gw-ice) !important; color: var(--gw-navy) !important; }
}

/* ---------------------------------------------------------------------
   11. Reduced motion: no rise, no fade timing, no hover lift
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html body #agModal.is-open,
    html body #agModal.is-open .ag-modal-dialog,
    html body #heOtpBackdrop[style*="flex"],
    html body #heOtpBackdrop[style*="flex"] .he-otp-modal { animation: none; }
    html body :is(#loginModal, #generalQueryModal, #storymodal, #storyvideomodal, #playVideoModal, #playVideoModalforBooking, #playVideoModalforcounsultant, #playVideoModalforrefer).fade,
    html body :is(#loginModal, #generalQueryModal, #storymodal, #storyvideomodal, #playVideoModal, #playVideoModalforBooking, #playVideoModalforcounsultant, #playVideoModalforrefer) .modal-dialog { transition: none !important; transform: none !important; }
    html body :is(#gwStudentModal, #heOtpBackdrop, #gwFrModal, #agModal, #loginModal, #generalQueryModal) :is(button, input, select) { transition: none !important; }
    html body :is(#gwStudentModal, #heOtpBackdrop, #gwFrModal, #agModal, #loginModal, #generalQueryModal) button:hover { transform: none !important; }
}
