@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&display=swap');

/* ============================================================
   Gurunivas Institute — shared overrides
   Loaded AFTER each page's own stylesheet, so rules here win.
   Holds every style added for the October 2026 client change list:
     1. brand / institute name treatment      (nav)
     2. three-branch circular hero            (homepage)
     3. leadership cards + 3-row arrangement
     4. faculty teaching / non-teaching grid
     5. student feedback sizing
     6. five-box "Why Gurunivas" grid
   Keeping these in one file means a shared-component restyle is a
   single edit instead of one per page stylesheet.
   ============================================================ */

/* ---------- 1. brand / institute name ---------------------- */
.brand .bt {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 1.52rem;
  letter-spacing: -.01em;
  color: var(--red);
}

/* footer sits on a dark panel — keep it readable there */
.f-brand .brand .bt {
  color: #fff;
}

.brand .gnv-logo {
  width: 58px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
}

@media(max-width:760px) {
  .brand .bt {
    font-size: 1.24rem;
  }
}

/* ---------- 2. three-branch circular hero ------------------ */
.branch-stage {
  position: absolute;
  inset: 0;
  z-index: 3;
}

/* centred on the same point as .arc-gold (left 50% / top 46%) so the
   circles sit concentric with the decorative ring behind them */
.branch-orbit {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 460px;
  aspect-ratio: 1;
}

/* dashed triangle connecting the three branch centres */
.branch-links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

/* dashed ring connecting the three branch centres, curved along the orbit */
.branch-links circle {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.2;
  stroke-dasharray: 4 6;
  stroke-linecap: round;
  opacity: .55;
  animation: branch-dash 26s linear infinite;
}

  .branch-links circle {
    animation: none;
  }

.branch-links polygon {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.5;
  stroke-dasharray: 5 7;
  opacity: .55;
  animation: branch-dash 26s linear infinite;
}

@keyframes branch-dash {
  to {
    stroke-dashoffset: -240;
  }
}

/* Each branch rides a rotating arm pinned to the orbit centre.
   The arm turns, the circle counter-turns by the same angle — so the
   photo sweeps along the ring and stays upright. The featured slot is
   a fixed angle, so the big circle never moves; the branches come to it. */
.branch-arm {
  position: absolute;
  left: 50%;
  top: 50%;
  height: 0;
  transform-origin: 0 0;
  transform: rotate(var(--a, 0deg));
  transition: transform 1.05s cubic-bezier(.45, .05, .2, 1);
}

.branch {
  position: absolute;
  left: 100%;
  top: 0;
  width: 196px;
  height: 196px;
  margin: -98px 0 0 -98px;
  border-radius: 50%;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  transform: rotate(calc(-1 * var(--a, 0deg))) scale(.54);
  transition: transform 1.05s cubic-bezier(.45, .05, .2, 1), box-shadow .85s ease;
  z-index: 2;
}

.branch.is-featured {
  transform: rotate(calc(-1 * var(--a, 0deg))) scale(1);
  z-index: 5;
}

.branch-disc {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--a1, #e8353c), var(--a2, #a1141b));
  border: 5px solid #fff;
  box-shadow: 0 16px 40px rgba(22, 34, 79, .22);
  transition: box-shadow .5s ease;
}

.branch.is-featured .branch-disc {
  box-shadow: 0 26px 60px rgba(216, 31, 39, .34), 0 0 0 7px rgba(201, 162, 39, .28);
}

.branch-disc img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* branch photos are square crops and need no nudge; student portraits sit
     high in frame and pass their own focal point, same as the other cards */
  object-position: var(--focus, center);
}

/* shown when the branch photo is missing — matches the site's
   existing onerror="this.remove()" + initials pattern */
.branch-disc .mono {
  font-family: var(--display);
  font-weight: 800;
  font-size: 3.1rem;
  color: rgba(255, 255, 255, .94);
  letter-spacing: .02em;
  line-height: 1;
}

.branch.is-small .branch-disc .mono {
  font-size: 3.6rem;
}

.branch-name {
  position: absolute;
  left: 50%;
  bottom: -14px;
  transform: translateX(-50%);
  white-space: nowrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50px;
  padding: 7px 16px;
  font-family: var(--display);
  font-weight: 700;
  font-size: .8rem;
  color: var(--navy);
  box-shadow: var(--sh);
  opacity: 0;
  transition: opacity .5s ease .2s;
  pointer-events: none;
}

.branch.is-featured .branch-name {
  opacity: 1;
}

.branch-name i {
  color: var(--red);
  margin-right: 7px;
}

/* dots telling the viewer which branch is showing */
.branch-dots {
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  display: flex;
  gap: 9px;
  z-index: 6;
}

.branch-dots button {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(22, 34, 79, .22);
  cursor: pointer;
  transition: .3s;
}

.branch-dots button.on {
  background: var(--red);
  transform: scale(1.35);
}

@media(max-width:980px) {
  .branch-orbit {
    max-width: 380px;
  }

  .branch {
    width: 162px;
    height: 162px;
    margin: -81px 0 0 -81px;
  }
}

@media(max-width:560px) {
  .branch-orbit {
    max-width: 300px;
  }

  .branch {
    width: 132px;
    height: 132px;
    margin: -66px 0 0 -66px;
  }

  .branch-disc {
    border-width: 4px;
  }

  .branch-disc .mono {
    font-size: 2.2rem;
  }

  .branch-name {
    font-size: .7rem;
    padding: 5px 11px;
  }
}

@media(prefers-reduced-motion:reduce) {

  .branch,
  .branch-arm {
    transition: none;
  }

  .branch-links polygon {
    animation: none;
  }
}

/* ---------- 3. leadership: name first, three rows ---------- */
.lead-rows {
  max-width: 980px;
  margin: 0 auto;
}

.lead-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
  margin-bottom: 22px;
}

.lead-row:last-child {
  margin-bottom: 0;
}

.lead-row .lcard {
  flex: 0 1 330px;
  /* name first, details stacked beneath */
  flex-direction: column;
  text-align: center;
  gap: 14px;
  padding: 28px 24px;
}

.lead-row .lcard .av {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  margin: 0 auto;
}

.lead-row .lcard h4 {
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.lead-row .lcard .role {
  margin: 0 0 4px;
  font-size: .86rem;
}

.lead-row .lcard .dept {
  font-family: var(--display);
  font-weight: 600;
  font-size: .84rem;
  color: var(--slate);
}

/* ---------- 4. faculty: teaching / non-teaching ------------ */
.fac-group {
  margin-top: 34px;
}

.fac-group:first-of-type {
  margin-top: 8px;
}

.fac-group-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.fac-group-head h3 {
  font-size: 1.22rem;
  white-space: nowrap;
}

.fac-group-head::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Flex rather than grid so a partial last row centres instead of
   stranding a lone card on the left — the staff count changes as the
   institute sends updates, so the layout must not assume a multiple. */
.fac-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.fac-grid .fcard {
  flex: 0 1 272px;
  max-width: 272px;
}

.fcard {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--sh);
  transition: transform .25s, box-shadow .25s;
}

.fcard:hover {
  transform: translateY(-6px);
  box-shadow: var(--sh-lg);
}

/* Portrait frame. The source photos are 600×800 (3:4); a short,
   wide frame cropped the tops of heads off, so the frame is kept
   close to the photo's own shape and almost nothing is lost. */
.fcard .photo {
  position: relative;
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(150deg, var(--a1, #e8353c), var(--a2, #a1141b));
}

.fcard .photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* per-person focal point — set as `focus` in assets/js/staff.js */
  object-position: var(--focus, 50% 20%);
}

.fcard .photo .mono {
  font-family: var(--display);
  font-weight: 800;
  font-size: 3.4rem;
  color: rgba(255, 255, 255, .92);
}

.fcard .body {
  padding: 16px 18px 20px;
  text-align: center;
}

.fcard .body h4 {
  font-size: 1.06rem;
}

/* designation */
.fcard .body .desig {
  font-family: var(--display);
  font-weight: 700;
  font-size: .84rem;
  color: var(--red);
  margin: 5px 0 2px;
}

/* department */
.fcard .body .dept {
  font-size: .82rem;
  color: var(--slate);
}

.fac-note {
  margin-top: 16px;
  font-size: .86rem;
  color: var(--muted);
  text-align: center;
}

@media(max-width:820px) {
  .fac-grid .fcard {
    flex-basis: 240px;
    max-width: 240px;
  }
}

@media(max-width:560px) {
  .fac-grid .fcard {
    flex-basis: 100%;
    max-width: 320px;
  }
}

/* ---------- 4a. student achiever cards ---------------------
   Same fix as the faculty cards: the supplied student photos are
   portrait, so a short landscape frame cropped their heads. The
   frame follows the photo's shape and each student carries a focal
   point (`focus` in assets/js/students.js). */
.mqp .photo {
  height: auto;
  aspect-ratio: 4 / 5;
}

.mqp .photo img {
  object-position: var(--focus, 50% 20%);
}

/* a longer college name must not make one card taller than the rest */
.marquee-group {
  align-items: stretch;
}

.mqp {
  display: flex;
  flex-direction: column;
}

.mqp .photo {
  flex: none;
}

.mqp .body {
  flex: 1 1 auto;
}

/* the achievement pill can run to two words — keep it readable */
.mqp .photo .pill {
  max-width: calc(100% - 24px);
  line-height: 1.25;
}

.mqp .body .ex {
  line-height: 1.45;
}

/* ---------- 4b. homepage faculty: fixed row + marquee -------
   The homepage drops the teaching / non-teaching split. Five people
   sit on one row that stays one row on desktop, and the rest scroll
   past underneath. Both lists live in assets/js/staff.js. */

.fac-featured {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  align-items: stretch;
}

/* the row is fixed, so the cards size themselves to it */
.fac-featured .fcard {
  width: 100%;
  max-width: none;
}

/* a long name must not push one card taller than its neighbours */
.fcard--lead,
.fcard--mq {
  display: flex;
  flex-direction: column;
}

.fcard--lead .photo,
.fcard--mq .photo {
  flex: none;
}

.fcard--lead .body,
.fcard--mq .body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

/* two lines reserved for the name, so designation and department
   line up across the row however long a name is */
.fcard--lead .body h4,
.fcard--mq .body h4 {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6em;
}

.fac-featured .fcard .body {
  padding: 15px 12px 18px;
}

.fac-featured .fcard .body h4 {
  font-size: 1rem;
  line-height: 1.3;
}

/* ---- marquee ---- */
.fac-mq {
  position: relative;
  margin-top: 26px;
  overflow: hidden;
  /* fade the two ends so cards enter and leave softly */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}

.fac-mq-track {
  display: flex;
  width: max-content;
  /* ~7s per card keeps the pace readable whatever the headcount */
  animation: fac-mq-scroll calc(var(--mq-count, 6) * 7s) linear infinite;
}

.fac-mq-set {
  display: flex;
  gap: 20px;
  padding: 10px 10px 16px;
}

.fac-mq:hover .fac-mq-track,
.fac-mq:focus-within .fac-mq-track {
  animation-play-state: paused;
}

.fac-mq .fcard--mq {
  flex: 0 0 210px;
  width: 210px;
}

.fac-mq .fcard--mq .body {
  padding: 14px 12px 16px;
}

.fac-mq .fcard--mq .body h4 {
  font-size: .98rem;
  line-height: 1.3;
}

@keyframes fac-mq-scroll {
  from { transform: translate3d(0, 0, 0); }
  /* one full set, plus the gap that follows its last card */
  to   { transform: translate3d(-50%, 0, 0); }
}

/* leadership portraits: same focal point as the faculty cards, so a
   face is not cropped to the chin inside the circle */
.lcard .av img {
  object-position: var(--focus, 50% 20%);
}

@media(max-width:1080px) {
  .fac-featured {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    max-width: 760px;
    margin-inline: auto;
  }
}

@media(max-width:720px) {
  .fac-featured {
    grid-template-columns: repeat(2, 1fr);
    max-width: 520px;
  }

  .fac-mq .fcard--mq {
    flex: 0 0 180px;
    width: 180px;
  }
}

@media(max-width:420px) {
  .fac-featured {
    grid-template-columns: 1fr;
    max-width: 300px;
  }
}

/* no auto-scroll for visitors who have asked for less motion —
   the strip stays, and can be scrolled by hand */
@media(prefers-reduced-motion:reduce) {
  .fac-mq {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .fac-mq-track {
    animation: none;
  }

  .fac-mq-set[aria-hidden="true"] {
    display: none;
  }
}

/* ---------- 5. student feedback: larger, more prominent ---- */
.mqt {
  width: 420px;
}

.mqt p {
  font-size: 1.1rem;
  line-height: 1.62;
  color: var(--ink);
}

.mqt .stars {
  font-size: 1rem;
}

.mqt .who b {
  font-size: 1rem;
}

.mqt .who span {
  font-size: .84rem;
}

@media(max-width:760px) {
  .mqt {
    width: 300px;
    padding: 22px;
  }

  .mqt p {
    font-size: 1rem;
  }
}

/* ---------- 6. five-box "Why Gurunivas" grid --------------- */
.why-grid {
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.why-grid .wcard {
  padding: 24px 18px;
}

.why-grid .wcard .ico {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-size: 1.14rem;
  margin-bottom: 13px;
}

.why-grid .wcard h4 {
  font-size: 1rem;
}

.why-grid .wcard p {
  font-size: .87rem;
}

@media(max-width:1180px) {
  .why-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media(max-width:860px) {
  .why-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media(max-width:560px) {
  .why-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- 7. hero: institute title + quote ---------------- */
.hero-copy .inst-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: clamp(1.5rem, 2.9vw, 2.15rem);
  color: var(--navy);
  letter-spacing: -.01em;
  margin-bottom: 11px;
}

.hero-copy .inst-title .r {
  color: var(--red);
}

.hero-quote {
  font-style: italic;
  font-size: clamp(.98rem, 1.5vw, 1.12rem);
  color: var(--slate);
  border-left: 3px solid var(--gold);
  padding-left: 15px;
  margin-bottom: 24px;
  max-width: 520px;
}

/* title font size increased per the client's note */
.hero h1 {
  font-size: clamp(2.7rem, 5.8vw, 4.5rem);
}

@media(max-width:980px) {
  .hero-copy .inst-title {
    text-align: center;
  }

  .hero-quote {
    margin-inline: auto;
    text-align: center;
    border-left: 0;
    border-top: 3px solid var(--gold);
    padding: 13px 0 0;
  }
}

/* ---------- 8. gallery page -------------------------------- */
.gal-filters[hidden] {
  display: none;
}

.gal-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: -24px 0 34px;
}

.gal-chip {
  font-family: var(--display);
  font-weight: 700;
  font-size: .86rem;
  color: var(--slate);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50px;
  padding: 9px 18px;
  cursor: pointer;
  transition: .2s;
}

.gal-chip:hover {
  color: var(--navy);
  border-color: var(--navy);
}

.gal-chip.on {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 10px 22px rgba(216, 31, 39, .26);
}

/* centred flex, like .fac-grid — the photo count will grow over time
   and must not strand a lone tile */
.gal-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.gal-grid .gal-item {
  flex: 0 1 282px;
  max-width: 282px;
}

.gal-item {
  position: relative;
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  background: var(--soft-2);
  border: 1px solid var(--line);
  box-shadow: var(--sh);
  transition: transform .25s, box-shadow .25s;
}

.gal-item[hidden] {
  display: none;
}

.gal-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--sh-lg);
}

.gal-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 22%;
}

.gal-item figcaption {
  padding: 14px 16px 16px;
  font-size: .88rem;
  color: var(--slate);
  background: #fff;
}

.gal-item .gal-cat {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 5px;
}

@media(max-width:560px) {
  .gal-grid .gal-item {
    flex-basis: 100%;
    max-width: 340px;
  }
}

/* ---------- 9. About Us page ------------------------------- */

/* Standalone prose block. The existing pages only style
   ".split .lead-copy p", where the .split grid constrains the
   column — used on its own the text runs the full container
   width, which is far too long a line to read comfortably. */
.lead-copy.prose {
  max-width: 740px;
  margin-inline: auto;
}

.lead-copy.prose p {
  color: var(--slate);
  font-size: 1.04rem;
  line-height: 1.75;
  margin-bottom: 18px;
}

.lead-copy.prose p:last-child {
  margin-bottom: 0;
}

/* .feat-grid is 3-up by default, which orphans the 4th card in a
   four-item section. This modifier makes it 4-up, then steps down. */
.feat-grid.four {
  grid-template-columns: repeat(4, 1fr);
}

@media(max-width:1180px) {
  .feat-grid.four {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media(max-width:640px) {
  .feat-grid.four {
    grid-template-columns: 1fr;
  }
}

/* ---------- 10. nav breakpoint ------------------------------
   The desktop menu switched to the burger at 760px, which fitted
   the original 7 nav items. "About Us" and "Gallery" widen the
   menu from ~481px to ~647px, so it no longer fits between 760px
   and ~930px. Moving the switch to 980px restores a clean nav.
   The rules below mirror the existing 760px block so the mobile
   menu behaves identically in the widened range.
   ------------------------------------------------------------ */
@media(max-width:980px) {

  .menu,
  .nav .btn {
    display: none;
  }

  .burger {
    display: flex;
  }

  .menu.open {
    display: flex;
    position: absolute;
    top: 78px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 12px 12px 14px;
    gap: 4px;
  }

  .menu.open .has-mega {
    flex-direction: column;
    align-items: stretch;
  }

  .menu.open .has-mega>a {
    justify-content: space-between;
  }

  .menu.open .has-mega>a i {
    transition: transform .25s;
  }

  .menu.open .mega {
    display: none;
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    width: 100%;
    box-shadow: none;
    border: 0;
    border-radius: 0;
    padding: 2px 0 8px 14px;
    margin-top: 2px;
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .menu.open .has-mega.open .mega {
    display: grid;
  }

  .menu.open .has-mega.open>a {
    color: var(--navy);
    background: var(--soft-2);
  }

  .menu.open .has-mega.open>a i {
    transform: rotate(180deg);
  }

  .menu.open .mega h5 {
    margin: 8px 0 2px;
  }

  .menu.open .m-cta {
    display: block;
    margin-top: 10px;
  }

  .menu.open .m-cta .btn {
    display: inline-flex;
    width: 100%;
  }
}


/* ---------- 11. JEE & NEET combined track page ------------- */
.track-pick {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.track-card {
  flex: 1 1 320px;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 26px;
  box-shadow: var(--sh);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}

.track-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--sh-lg);
  border-color: var(--red);
}

.track-card .t-ico {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  color: #fff;
  background: var(--accent, #d81f27);
  margin-bottom: 10px;
}

.track-card b {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.22rem;
  color: var(--navy);
}

.track-card .t-sub {
  font-family: var(--display);
  font-weight: 700;
  font-size: .84rem;
  color: var(--red);
}

.track-card .t-meta {
  font-size: .9rem;
  color: var(--slate);
  margin-top: 4px;
}

.track-card .t-go {
  margin-top: 16px;
  font-family: var(--display);
  font-weight: 700;
  font-size: .9rem;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.track-card:hover .t-go {
  color: var(--red);
}

.track-card:hover .t-go i {
  transform: translateX(4px);
}

.track-card .t-go i {
  transition: transform .22s;
}

/* anchor targets must clear the sticky header */
#jee,
#neet,
#tracks {
  scroll-margin-top: 96px;
}

/* Programme grid: merging JEE and NEET leaves four cards, which strand a
   lone card in the 3-column grid. Centred flex keeps any count tidy —
   same treatment as .fac-grid and .gal-grid. */
.prog-grid {
  display: flex;
  flex-wrap: wrap;
  /* justify-content: center; */
  gap: 22px;
}

.prog-grid .pcard {
  flex: 1 1 320px;
  max-width: 380px;
}

@media(max-width:560px) {
  .prog-grid .pcard {
    flex-basis: 100%;
    max-width: 100%;
  }
}

/* ============================================================
   7. COURSE PAGES — PHASE 2 CORRECTIONS
   Components added for the Phase 2 course-page review
   (Foundation 8, Board 9–10, Class 11–12, JEE & NEET).
   ============================================================ */

/* ---------- 7a. qualitative stat boxes ---------------------
   Several Phase 2 stat boxes name a quality, not a count
   ("Conceptual Teaching", "Weekly Test", "Objective Test"). The
   change document is explicit that no statistic should be invented
   where none applies, so these boxes lead with their icon and
   promote the label into the headline slot. */
.fact.qual i {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.fact.qual span {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  color: #fff;
  margin-top: 0;
}

.rnum.qual .ico {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--gold));
}

.rnum.qual span {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.06rem;
  line-height: 1.3;
  color: var(--navy);
  margin-top: 0;
}

/* ---------- 7b. hero visual: four student circles ----------
   Replaces the single .ph-badge disc on the Board 9–10 and
   Class 11–12 heroes. Four photographed students ride a dashed
   gold ring around a centred programme disc. Photos come from
   assets/image/students/ via assets/js/students.js; the initials
   underneath show if a photo is missing, so nothing looks broken. */
.ph-faces {
  position: relative;
  width: 100%;
  height: 300px;
  display: grid;
  place-items: center;
}

.ph-faces .ring {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 2px dashed rgba(201, 162, 39, .6);
}

.ph-faces .core {
  position: absolute;
  width: 136px;
  height: 136px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 10px;
  color: #fff;
  background: radial-gradient(120% 120% at 30% 20%, #e8353c, var(--red) 55%, var(--red-d));
  box-shadow: 0 20px 48px rgba(216, 31, 39, .3);
}

.ph-faces .core b {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.75rem;
  line-height: 1;
}

.ph-faces .core span {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #ffe3b0;
  margin-top: 5px;
}

.ph-faces .face {
  position: absolute;
  width: 98px;
  height: 98px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 4px solid #fff;
  box-shadow: 0 12px 28px rgba(22, 34, 79, .22);
  background: linear-gradient(150deg, var(--a1, #e8353c), var(--a2, #a1141b));
}

.ph-faces .face img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus, 50% 20%);
}

.ph-faces .face span {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.3rem;
  color: #fff;
}

/* 92px on each diagonal keeps a 98px circle (49px radius) inside the
   300px box — 92 + 49 = 141 against a 150px half-width.
   Positions are keyed off .f1–.f4, set by students.js, rather than
   :nth-of-type — the .ring and .core are divs too, so nth-of-type would
   count them and leave the fourth face stranded in the middle. */
.ph-faces .face.f1 { transform: translate(-92px, -92px) }
.ph-faces .face.f2 { transform: translate(92px, -92px) }
.ph-faces .face.f3 { transform: translate(92px, 92px) }
.ph-faces .face.f4 { transform: translate(-92px, 92px) }

/* mirrors the existing .ph-badge breakpoints in gnv.css */
@media(max-width:980px) {
  .ph-faces {
    order: -1;
    height: 260px;
  }
}

@media(max-width:420px) {
  .ph-faces {
    height: 232px;
  }

  .ph-faces .ring { width: 212px; height: 212px }
  .ph-faces .core { width: 112px; height: 112px }
  .ph-faces .core b { font-size: 1.45rem }
  .ph-faces .face { width: 78px; height: 78px; border-width: 3px }
  .ph-faces .face.f1 { transform: translate(-75px, -75px) }
  .ph-faces .face.f2 { transform: translate(75px, -75px) }
  .ph-faces .face.f3 { transform: translate(75px, 75px) }
  .ph-faces .face.f4 { transform: translate(-75px, 75px) }
}

/* ---------- 7c. achievers wall on course pages -------------
   The "dedicated section similar to Results That Speak" asked for on
   each course page: the homepage achiever card in a static, centred
   grid rather than a marquee, so a short row still reads as deliberate.

   The base .mqp rules live in index.css, which course pages don't
   load — so they are restated here scoped to .ach-grid. Scoping keeps
   the homepage marquee untouched. */
.ach-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 22px;
}

.ach-grid .mqp {
  width: auto;
  flex: 1 1 230px;
  max-width: 258px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--sh);
  transition: transform .25s, box-shadow .25s;
}

.ach-grid .mqp:hover {
  transform: translateY(-6px);
  box-shadow: var(--sh-lg);
}

.ach-grid .mqp .photo {
  position: relative;
  flex: none;
  height: auto;
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(150deg, var(--a1, #e8353c), var(--a2, #a1141b));
}

.ach-grid .mqp .photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus, 50% 20%);
}

/* Left unpositioned on purpose, exactly as index.css has it: a static grid
   item paints beneath the absolutely-positioned photo, so the initials show
   only when the image is missing. Giving it `position` would float it over
   the student's face. */
.ach-grid .mqp .photo .mono {
  font-family: var(--display);
  font-weight: 800;
  font-size: 2.6rem;
  letter-spacing: .02em;
  color: rgba(255, 255, 255, .92);
}

.ach-grid .mqp .photo .pill {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  max-width: calc(100% - 24px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 50px;
  background: rgba(255, 255, 255, .94);
  font-family: var(--display);
  font-weight: 700;
  font-size: .74rem;
  line-height: 1.25;
  color: var(--navy);
  box-shadow: 0 6px 16px rgba(22, 34, 79, .18);
}

.ach-grid .mqp .photo .pill i {
  color: var(--red);
}

/* centred, matching the same card on the homepage */
.ach-grid .mqp .body {
  flex: 1 1 auto;
  padding: 16px 16px 18px;
  text-align: center;
}

.ach-grid .mqp .body h4 {
  font-size: 1rem;
  margin-bottom: 3px;
}

.ach-grid .mqp .body .line {
  font-family: var(--display);
  font-weight: 700;
  font-size: .82rem;
  color: var(--red);
}

.ach-grid .mqp .body .ex {
  font-size: .76rem;
  line-height: 1.45;
  color: var(--muted);
  margin-top: 3px;
}

@media(max-width:560px) {
  .ach-grid .mqp {
    flex-basis: 100%;
    max-width: 300px;
  }
}

/* ---------- 7d. topper cards with real photos --------------
   The Phase 2 student-highlight boxes carry photographs. .topper .av
   already supports an <img> (gnv.css); this only adds the focal point,
   since the supplied portraits sit high in frame. */
.topper .av img {
  object-position: var(--focus, 50% 18%);
}

/* A row of three or fewer highlight cards should centre rather than
   strand a gap on the right. */
.toppers.flex {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 28px;
}

.toppers.flex .topper {
  flex: 1 1 240px;
  max-width: 290px;
}

@media(max-width:560px) {
  .toppers.flex .topper {
    flex-basis: 100%;
    max-width: 100%;
  }
}

/* ============================================================
   8. PHASE 3 — WHY US, RESULTS AND GALLERY
   ============================================================ */

/* ---------- 8a. five-circle hero ring ----------------------
   The Results hero shows five centum students (§2.1). Five points on
   the ring sit 72° apart starting at the top, so the geometry differs
   from the four-circle version in section 7b. A smaller radius and
   circle keep all five inside the 300px box:
   0.951 × 104 + 42 = 141, against a 150px half-width. */
.ph-faces.five .face {
  width: 84px;
  height: 84px;
}

.ph-faces.five .core {
  width: 104px;
  height: 104px;
}

.ph-faces.five .core b { font-size: 1.5rem }

.ph-faces.five .face.f1 { transform: translate(0, -104px) }
.ph-faces.five .face.f2 { transform: translate(99px, -32px) }
.ph-faces.five .face.f3 { transform: translate(61px, 84px) }
.ph-faces.five .face.f4 { transform: translate(-61px, 84px) }
.ph-faces.five .face.f5 { transform: translate(-99px, -32px) }

.ph-faces.five .ring {
  width: 208px;
  height: 208px;
}

@media(max-width:420px) {
  .ph-faces.five .face { width: 66px; height: 66px; border-width: 3px }
  .ph-faces.five .core { width: 84px; height: 84px }
  .ph-faces.five .ring { width: 168px; height: 168px }
  .ph-faces.five .face.f1 { transform: translate(0, -84px) }
  .ph-faces.five .face.f2 { transform: translate(80px, -26px) }
  .ph-faces.five .face.f3 { transform: translate(49px, 68px) }
  .ph-faces.five .face.f4 { transform: translate(-49px, 68px) }
  .ph-faces.five .face.f5 { transform: translate(-80px, -26px) }
}

/* ---------- 8b. rolling row off the homepage ---------------
   §2.1 replaces the Results four-box strip with the homepage's rolling
   row. The homepage styles live in index.css and lean on variables that
   page defines, so the rule set is restated here against the shared
   palette — this is what makes the row usable on any page. */
.ticker {
  background: var(--navy);
  color: #fff;
  overflow: hidden;
  border-top: 3px solid var(--gold);
}

.ticker-track {
  display: flex;
  gap: 0;
  white-space: nowrap;
  animation: gnv-ticker 26s linear infinite;
  will-change: transform;
}

.ticker:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-track span {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  padding: 16px 0;
  display: inline-flex;
  align-items: center;
}

.ticker-track span::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  margin: 0 28px;
}

@keyframes gnv-ticker {
  to { transform: translateX(-50%) }
}

@media(prefers-reduced-motion:reduce) {
  .ticker-track { animation: none !important }
}

/* ---------- 8c. two-card exam grid -------------------------
   §2.3 cuts "Exam by exam" from three cards to two; the existing
   three-column grid would leave them stretched across the full width. */
.exam-grid.two {
  grid-template-columns: repeat(2, 1fr);
  max-width: 860px;
  margin-inline: auto;
}

@media(max-width:760px) {
  .exam-grid.two { grid-template-columns: 1fr }
}

/* ---------- 8d. Gallery: Founder's Day --------------------- */
.fd-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 34px;
  margin: -22px 0 10px;
}

.fd-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.fd-label {
  font-family: var(--display);
  font-weight: 700;
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* the shared .gal-filters margin is for a standalone row; inside a
   labelled group it has to sit flush */
.fd-group .gal-filters {
  margin: 0;
}

.fd-count {
  text-align: center;
  color: var(--muted);
  font-size: .84rem;
  margin: 0 0 28px;
}

/* the photo is a button so it can open the lightbox from the keyboard */
.gal-zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
}

.gal-zoom:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: -3px;
}

/* ---------- 8e. Lightbox ----------------------------------- */
.lbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 24px;
  background: rgba(10, 14, 32, .96);
}

.lbox[hidden] {
  display: none;
}

.lbox-fig {
  margin: 0;
  min-width: 0;
  text-align: center;
}

.lbox-fig img {
  max-width: 100%;
  max-height: 78vh;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}

.lbox-fig figcaption {
  margin-top: 14px;
  color: #e7eaf6;
  font-family: var(--display);
  font-weight: 600;
  font-size: .92rem;
}

.lbox-x,
.lbox-nav {
  border: 0;
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: background .2s;
}

.lbox-x:hover,
.lbox-nav:hover {
  background: var(--red);
}

.lbox-nav {
  width: 48px;
  height: 48px;
  font-size: 2rem;
  line-height: 1;
}

.lbox-x {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  font-size: 1.6rem;
  line-height: 1;
}

@media(max-width:620px) {
  .lbox {
    grid-template-columns: 1fr;
    grid-template-areas: 'fig' 'nav';
    justify-items: center;
  }

  .lbox-fig { grid-area: fig }
  .lbox-nav { grid-area: nav; margin-top: 8px }
  .lbox-nav.prev { justify-self: start }
  .lbox-nav.next { justify-self: end }
}

/* ---------- 8f. Gallery: Alumni ---------------------------- */
.alum-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
  margin-bottom: 44px;
}

.alum-card {
  flex: 1 1 240px;
  max-width: 290px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 22px 24px;
  text-align: center;
  box-shadow: var(--sh);
  transition: transform .25s, box-shadow .25s;
}

.alum-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--sh-lg);
}

.alum-face {
  position: relative;
  width: 104px;
  height: 104px;
  margin: 0 auto 16px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 4px solid #fff;
  box-shadow: 0 10px 26px rgba(22, 34, 79, .2);
  background: linear-gradient(150deg, var(--a1, #e8353c), var(--a2, #a1141b));
}

.alum-face img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus, 50% 20%);
}

.alum-face span {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;
  color: #fff;
}

.alum-card h4 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.alum-now {
  font-family: var(--display);
  font-weight: 700;
  font-size: .9rem;
  color: var(--red);
  line-height: 1.35;
}

.alum-where {
  font-size: .84rem;
  color: var(--slate);
  margin-top: 2px;
}

.alum-batch {
  font-size: .76rem;
  color: var(--muted);
  margin-top: 8px;
}

/* the panel that invites the rest of the wall to fill itself in */
.alum-cta {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 38px;
  align-items: center;
  background: var(--soft-2);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 38px 36px;
}

.alum-cta h3 {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  margin: 12px 0 12px;
}

.alum-cta p {
  color: var(--slate);
  font-size: .95rem;
  margin-bottom: 22px;
}

.alum-cta-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.alum-cta-list li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}

.alum-cta-list i {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: .9rem;
  color: var(--navy);
  background: linear-gradient(135deg, var(--gold-l), var(--gold));
}

.alum-cta-list b {
  display: block;
  font-size: .92rem;
}

.alum-cta-list span {
  display: block;
  font-size: .82rem;
  color: var(--muted);
  margin-top: 2px;
}

@media(max-width:860px) {
  .alum-cta {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 30px 24px;
  }
}

@media(max-width:560px) {
  .alum-card {
    flex-basis: 100%;
    max-width: 320px;
  }
}

/* ============================================================
   9. PHASE 4 — FACULTY, CENTRES AND THE ENQUIRY FORM
   ============================================================ */

/* ---------- 9a. subject tick boxes -------------------------
   §3.3 asks for checkboxes rather than a dropdown, with the choices
   following the selected class. */
.checks-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 2px;
}

.checks-hint {
  margin: 0;
  font-size: .86rem;
  color: var(--muted);
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 15px 9px 12px;
  border: 1px solid var(--line);
  border-radius: 50px;
  background: #fff;
  cursor: pointer;
  font-size: .92rem;
  color: var(--navy);
  transition: border-color .2s, background .2s, box-shadow .2s;
}

.checkbox:hover {
  border-color: var(--red);
}

.checkbox input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--red);
  cursor: pointer;
  flex: none;
}

.checkbox:has(input:checked) {
  border-color: var(--red);
  background: #fff5f5;
  box-shadow: 0 2px 10px rgba(216, 31, 39, .12);
  font-weight: 600;
}

.checkbox:focus-within {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* JEE and NEET: the group is shown but carries no choices */
#subject-field.is-disabled .checks-hint {
  color: var(--slate);
  font-style: italic;
}

/* a disabled Classes select should read as waiting, not broken */
.sel select:disabled {
  opacity: .62;
  cursor: not-allowed;
}

/* ---------- 9b. centres hero orbit -------------------------
   §2.1 puts the homepage's three-circle design on the Centres hero.
   The .branch-* rules already live in this file (section 3); this
   only gives the stage the height the hero column expects, matching
   the .ph-badge breakpoints in the page stylesheets. */
/* A standalone orbit stage, for pages that give the ring a column of its own
   (Centres hero, course heroes). The homepage is deliberately NOT included:
   there the stage is .branch-stage, positioned absolute and centred on the same
   point as the decorative gold arc behind it. An earlier version of this rule
   used #branch-stage, whose id beats that class — which pulled the homepage
   ring off-centre from its own arc. Scoped to .orbit-stage so it cannot. */
.orbit-stage {
  position: relative;
  width: 100%;
  min-height: 480px;
  display: grid;
  place-items: center;
}

/* The ring is 460px and the arm length is measured from it, so shrinking the
   orbit throws the circle spacing out. The stage is given the room instead,
   and the ring is centred rather than sitting high, so nothing clips. */
.orbit-stage .branch-orbit {
  top: 50%;
}

@media(max-width:980px) {
  .orbit-stage {
    order: -1;
  }
}

@media(max-width:560px) {
  .orbit-stage {
    min-height: 400px;
  }

  .orbit-stage .branch-orbit {
    max-width: 380px;
  }
}

/* ---------- 10. stat boxes: vertical centring ---------------
   .res-nums is a grid, so every .rnum stretches to the tallest in the row —
   but their contents sat at the top, which left a short box like "94% /
   Continue to Class 9" floating above a pool of white space beside taller
   icon-led boxes. Centring the content fixes the whole row. */
.rnum {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* the icon keeps its own horizontal centring inside the flex column */
.rnum.qual .ico {
  flex: none;
}

/* ---------- 9c. Google rating badge -----------------------
   Sits under the "What our students say" heading and links to the
   listing the reviews came from. */
.g-rating {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 9px 18px 9px 14px;
  border: 1px solid var(--line);
  border-radius: 50px;
  background: #fff;
  box-shadow: var(--sh);
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}

.g-rating:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-lg);
}

.g-rating b {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--navy);
}

.g-rating .g-stars {
  display: inline-flex;
  gap: 2px;
  color: var(--gold);
  font-size: .82rem;
}

.g-rating .g-count {
  font-size: .84rem;
  color: var(--slate);
}

/* the band-head is centred text, so the inline-flex badge needs this */
.band-head.center .g-rating {
  margin-inline: auto;
}

/* ---------- 9d. honeypot ----------------------------------
   Kept out of sight without display:none or visibility:hidden, which
   some bots check for before deciding whether to fill a field. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- 9e. form-level status line --------------------
   For problems that belong to the whole form rather than one field:
   the server refused it, or the request never arrived. */
.form-status {
  margin: 14px 0 0;
  font-size: .92rem;
  line-height: 1.5;
}

.form-status:empty {
  display: none;
}

.form-status.is-error {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #f3c7c9;
  background: #fdf3f3;
  color: #a1141b;
}

.form-status.is-ok {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #cfe6d4;
  background: #f3faf5;
  color: #1d6b38;
}

/* the submit button while the enquiry is in flight */
#enquiryForm button[type="submit"]:disabled {
  opacity: .72;
  cursor: progress;
}

/* ============================================================
   11. ALUMNI-CONNECT POPUP  (/gallery/)
   ------------------------------------------------------------
   The enquiry page's form and modal styles live in contact.css, which
   the gallery page does not load. Rather than load that whole page
   stylesheet here — or copy its class names into this shared sheet,
   which would silently restyle the enquiry page, since this file loads
   after it — the popup carries its own gnv-modal- prefix and scopes the
   field styles inside it.
   ============================================================ */
.gnv-modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.gnv-modal[hidden] {
  display: none;
}

.gnv-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 24, 56, .55);
  backdrop-filter: blur(4px);
}

.gnv-modal-box {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #fff;
  border-radius: 24px;
  padding: 34px 32px 30px;
  box-shadow: var(--sh-lg);
  animation: gnv-pop .28s cubic-bezier(.2, .8, .3, 1.2);
}

.gnv-modal-box.is-narrow {
  max-width: 440px;
  text-align: center;
}

@keyframes gnv-pop {
  from { opacity: 0; transform: translateY(14px) scale(.97) }
  to   { opacity: 1; transform: none }
}

@media(prefers-reduced-motion:reduce) {
  .gnv-modal-box { animation: none }
}

.gnv-modal-box > h3 {
  font-size: clamp(1.25rem, 2.4vw, 1.5rem);
  margin-bottom: 8px;
}

.gnv-modal-sub {
  color: var(--slate);
  font-size: .92rem;
  margin-bottom: 22px;
}

.gnv-modal-x {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--soft-2);
  color: var(--navy);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .2s, color .2s;
}

.gnv-modal-x:hover {
  background: var(--red);
  color: #fff;
}

/* the success panel's tick */
.gnv-modal-box .m-ico {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  color: #fff;
  background: radial-gradient(120% 120% at 30% 20%, #2fbf6b, #1f9d54);
  box-shadow: 0 14px 30px rgba(31, 157, 84, .35);
}

.gnv-modal-box.is-narrow p {
  color: var(--slate);
  font-size: .98rem;
  margin-bottom: 24px;
}

.gnv-modal-box.is-narrow .btn {
  width: 100%;
}

/* ---------- fields, scoped to the popup ------------------- */
.gnv-modal .field {
  margin-bottom: 16px;
}

.gnv-modal .field label {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: .86rem;
  color: var(--navy);
  margin-bottom: 7px;
}

.gnv-modal .req {
  color: var(--red);
  margin-left: 2px;
}

.gnv-modal .field input[type="text"],
.gnv-modal .field input[type="email"],
.gnv-modal .field input[type="tel"],
.gnv-modal .field input[type="file"],
.gnv-modal .field select,
.gnv-modal .field textarea {
  width: 100%;
  font-family: var(--body);
  font-size: .96rem;
  color: var(--ink);
  background: var(--soft);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  transition: .18s;
  outline: none;
}

.gnv-modal .field textarea {
  resize: vertical;
  min-height: 86px;
}

.gnv-modal .field input:focus,
.gnv-modal .field select:focus,
.gnv-modal .field textarea:focus {
  border-color: var(--red);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(216, 31, 39, .1);
}

.gnv-modal .field input::placeholder,
.gnv-modal .field textarea::placeholder {
  color: var(--muted);
}

.gnv-modal .field-hint {
  display: block;
  font-size: .78rem;
  color: var(--muted);
  margin-top: 6px;
}

.gnv-modal .sel {
  position: relative;
}

.gnv-modal .sel::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--red);
  font-size: .8rem;
  pointer-events: none;
}

.gnv-modal .sel select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  cursor: pointer;
}

.gnv-modal .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* the consent tick sits on its own line, label beside the box */
.gnv-modal .field-check .checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 0;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  cursor: pointer;
  font-family: var(--body);
  font-weight: 400;
  font-size: .9rem;
  color: var(--slate);
  line-height: 1.45;
}

.gnv-modal .field-check .checkbox input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  flex: none;
  accent-color: var(--red);
  cursor: pointer;
}

.gnv-modal .field-check .checkbox:has(input:checked) {
  border-color: var(--red);
  background: #fff5f5;
}

.gnv-modal .field-error {
  display: none;
  font-size: .8rem;
  color: #c0182a;
  margin-top: 5px;
  padding-left: 2px;
}

.gnv-modal .field--error input,
.gnv-modal .field--error select,
.gnv-modal .field--error textarea,
.gnv-modal .field--error .checkbox {
  border-color: #e53048;
  background: #fff5f6;
  box-shadow: 0 0 0 3px rgba(229, 48, 72, .12);
}

.gnv-modal .field--error .field-error {
  display: block;
}

.gnv-modal button[type="submit"] {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}

.gnv-modal button[type="submit"]:disabled {
  opacity: .72;
  cursor: progress;
}

@media(max-width:560px) {
  .gnv-modal {
    padding: 12px;
  }

  .gnv-modal-box {
    padding: 28px 20px 24px;
    max-height: calc(100vh - 24px);
  }

  .gnv-modal .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
