/* ==========================================================================
   Gold Academy — Home page
   ========================================================================== */

.text-gold { color: var(--gold-400); }
.section-alt { background: var(--c-surface-2); }
[data-bs-theme="dark"] .section-alt { background: #0e1930; }

/* ---------- Hero slider (full-bleed photo per slide) ---------- */
.hero-slider { position: relative; background: var(--navy-950); color: var(--c-text-inv); --c-focus: var(--gold-400); }
.hero-slide {
  --finder-overlap: 64px;
  position: relative; overflow: hidden; isolation: isolate;
  min-height: clamp(520px, 68vh, 660px);
  display: flex; align-items: center;
  padding-block: 3.5rem calc(var(--finder-overlap) + 3rem);
}
.hero-slide > .container { width: 100%; }
.hero-bg {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
}
/* Readability: dark on the text side (right in RTL), photo shows through on the other side */
.hero-slide::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to left, rgba(10, 20, 38, .93) 0%, rgba(10, 20, 38, .84) 34%, rgba(10, 20, 38, .4) 66%, rgba(10, 20, 38, .12) 100%),
    linear-gradient(to top, rgba(10, 20, 38, .7) 0%, transparent 32%);
}
/* Slow settle of the photo on the active slide */
.carousel-item.active .hero-bg { animation: heroSettle 8s ease-out both; }
@keyframes heroSettle { from { transform: scale(1.07); } to { transform: scale(1); } }

.slide-copy { max-width: 620px; }
.slide-eyebrow {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  color: var(--gold-400); font-weight: 600; font-size: var(--fs-sm); margin-bottom: var(--sp-4);
}
.slide-eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--gold-400); }
.slide-title { color: #fff; font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3rem); line-height: 1.3; margin-bottom: var(--sp-5); }
.slide-lead { font-size: var(--fs-md); color: rgba(244, 239, 228, .82); max-width: 54ch; margin-bottom: var(--sp-8); }
.slide-cta { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

/* Entrance of the active slide's text */
.carousel-item.active .slide-copy > * { animation: slideUp var(--dur-slow) var(--ease) both; }
.carousel-item.active .slide-copy > :nth-child(2) { animation-delay: .08s; }
.carousel-item.active .slide-copy > :nth-child(3) { animation-delay: .16s; }
.carousel-item.active .slide-copy > :nth-child(4) { animation-delay: .24s; }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- Side arrows: previous on the right, next on the left (RTL) ---------- */
.slider-arrow {
  position: absolute; z-index: 3;
  top: calc(50% - var(--finder-overlap, 64px) / 2); transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; background: rgba(10, 20, 38, .35);
  border: 1px solid rgba(244, 239, 228, .3);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.slider-arrow .icon { width: 24px; height: 24px; }
.slider-arrow:hover { background: var(--gold-400); border-color: var(--gold-400); color: var(--navy-900); }
.slider-arrow--prev { inset-inline-start: 20px; }
.slider-arrow--next { inset-inline-end: 20px; }

@media (prefers-reduced-motion: reduce) {
  .carousel-item.active .hero-bg { animation: none; }
}
@media (min-width: 768px) and (max-width: 1399.98px) {
  .slide-copy { padding-inline-start: 56px; }   /* clear of the right arrow */
}

/* ---------- Finder bar (overlaps the slider) ---------- */
.finder-wrap { position: relative; z-index: 4; margin-top: -64px; }
.finder-bar {
  display: grid; grid-template-columns: auto 1fr; align-items: end; gap: var(--sp-6);
  padding: var(--sp-5) var(--sp-6);
  border: 0; border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
}
[data-bs-theme="dark"] .finder-bar { border: 1px solid var(--c-line); }
.finder-intro { display: flex; align-items: center; gap: var(--sp-3); padding-bottom: .35rem; }
.finder-title { font-size: var(--fs-md); margin: 0; }
.finder-sub { font-size: var(--fs-xs); color: var(--c-text-muted); margin: 0; }
.finder-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: var(--sp-4); align-items: end; }
.finder-step .form-label { margin-bottom: var(--sp-1); }
.step-no {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--c-accent-soft); color: var(--c-accent-ink);
  font-size: .6875rem; font-weight: 700; margin-inline-end: var(--sp-1);
}
.finder-status { grid-column: 1 / -1; margin: 0; color: var(--c-text-soft); }
.finder-status:empty { display: none; }
.finder-status.is-error { color: var(--c-danger); }

@media (max-width: 1199.98px) {
  .finder-bar { grid-template-columns: 1fr; gap: var(--sp-4); }
}
@media (max-width: 991.98px) {
  .hero-slide { min-height: 540px; }
  .finder-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .finder-action { grid-column: 1 / -1; }
}
@media (max-width: 767.98px) {
  .hero-slide { --finder-overlap: 40px; min-height: 600px; align-items: flex-end; padding-block: 3rem calc(var(--finder-overlap) + 5.5rem); }
  /* phones: the photo sits behind an even wash so text always reads */
  .hero-slide::after {
    background:
      linear-gradient(to top, rgba(10, 20, 38, .96) 0%, rgba(10, 20, 38, .8) 55%, rgba(10, 20, 38, .45) 100%);
  }
  .slide-lead { font-size: var(--fs-base); }
  /* arrows move to the bottom corners (right / left), above the finder */
  .slider-arrow { top: auto; transform: none; bottom: calc(40px + 1rem); width: 42px; height: 42px; }
  .slider-arrow--prev { inset-inline-start: 16px; }
  .slider-arrow--next { inset-inline-end: 16px; }
  .finder-wrap { margin-top: -40px; }
  .finder-bar { padding: var(--sp-5); }
  .finder-fields { grid-template-columns: 1fr; gap: var(--sp-3); }
}
@media (max-width: 480px) {
  .slide-cta .btn { flex: 1 1 auto; }
}

/* ---------- Perks strip ---------- */
.perks { padding-top: var(--sp-12); }

.perks-list {
  list-style: none; margin: 0; padding: var(--sp-6);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-6);
}
.perks-list li { display: flex; gap: var(--sp-4); align-items: flex-start; }
.perks-list li + li { border-inline-start: 1px solid var(--c-line); padding-inline-start: var(--sp-6); }
.perks-list h3 { font-size: var(--fs-base); margin-bottom: var(--sp-1); }
.perks-list p { font-size: var(--fs-sm); color: var(--c-text-muted); margin: 0; line-height: 1.6; }
@media (max-width: 1199.98px) {
  .perks-list { grid-template-columns: repeat(2, 1fr); }
  .perks-list li:nth-child(3) { border-inline-start: 0; padding-inline-start: 0; }
}
@media (max-width: 575.98px) {
  .perks-list { grid-template-columns: 1fr; padding: var(--sp-5); gap: var(--sp-5); }
  .perks-list li + li { border-inline-start: 0; padding-inline-start: 0; border-top: 1px solid var(--c-line); padding-top: var(--sp-5); }
}

/* ---------- Section top row (heading + action) ---------- */
.section-top {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: var(--sp-5); margin-bottom: var(--sp-10);
}

/* ---------- Stage boxes (colour tiles with 3D icon) ---------- */
.stage-box {
  --tile: var(--navy-700);
  --tile-ink: #fff;
  --tile-meta: rgba(244, 239, 228, .72);
  --ring: rgba(255, 255, 255, .1);
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 250px; height: 100%;
  padding: var(--sp-8) var(--sp-5) var(--sp-6);
  border-radius: var(--r-xl);
  background: var(--tile);
  color: var(--tile-ink); text-align: center; text-decoration: none;
  box-shadow: 0 14px 30px -20px rgba(15, 27, 51, .6);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
/* soft light from the top corner + faint concentric rings behind the icon */
.stage-box::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(255, 255, 255, .14) 0%, transparent 55%),
    radial-gradient(circle at 50% 42%, transparent 0 62px, var(--ring) 62px 63px, transparent 63px 92px, var(--ring) 92px 93px, transparent 93px);
}
.stage-box--basic      { --tile: #2a4f8c; }
.stage-box--secondary  { --tile: #1f3d6e; }
.stage-box--university { --tile: var(--navy-900); }
.stage-box--tawjihi {
  --tile: linear-gradient(160deg, #e7c172 0%, var(--gold-400) 45%, #c4943a 100%);
  --tile-ink: var(--navy-900);
  --tile-meta: rgba(15, 27, 51, .72);
  --ring: rgba(15, 27, 51, .1);
  box-shadow: 0 16px 34px -18px rgba(179, 134, 43, .75);
}

.stage-icon {
  position: relative; width: 104px; height: 104px; margin-bottom: var(--sp-5);
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  transition: transform var(--dur) var(--ease);
}
.stage-box--tawjihi .stage-icon { background: rgba(255, 255, 255, .35); }
.stage-icon img { width: 84px; height: 84px; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .25)); }
.stage-name { color: inherit; font-size: var(--fs-lg); font-weight: 800; margin: 0 0 var(--sp-1); }
.stage-meta { font-size: var(--fs-sm); color: var(--tile-meta); }
.stage-go {
  position: absolute; bottom: var(--sp-4); inset-inline-end: var(--sp-4);
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .14); color: inherit;
  opacity: 0; transform: translateX(6px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.stage-box--tawjihi .stage-go { background: var(--navy-900); color: var(--gold-400); }
.stage-flag {
  position: absolute; top: var(--sp-4); inset-inline-start: var(--sp-4);
  background: var(--navy-900); color: var(--gold-300);
  font-size: var(--fs-xs); font-weight: 700; padding: .2rem .7rem; border-radius: var(--r-pill);
}
.stage-box:hover, .stage-box:focus-visible { transform: translateY(-6px); color: var(--tile-ink); box-shadow: 0 24px 40px -22px rgba(15, 27, 51, .75); }
.stage-box:hover .stage-icon, .stage-box:focus-visible .stage-icon { transform: translateY(-4px) scale(1.04); }
.stage-box:hover .stage-go, .stage-box:focus-visible .stage-go { opacity: 1; transform: none; }
.stage-box:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 3px; }
[data-bs-theme="dark"] .stage-box { box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 14px 30px -20px rgba(0, 0, 0, .8); }
[data-bs-theme="dark"] .stage-box--university { --tile: #16264a; }
@media (hover: none) { .stage-go { opacity: 1; transform: none; } }
@media (max-width: 575.98px) {
  .stage-box { min-height: 200px; padding: var(--sp-6) var(--sp-3) var(--sp-5); border-radius: var(--r-lg); }
  .stage-icon { width: 80px; height: 80px; margin-bottom: var(--sp-3); }
  .stage-icon img { width: 64px; height: 64px; }
  .stage-name { font-size: var(--fs-base); }
  .stage-meta { font-size: var(--fs-xs); }
  .stage-go { display: none; }
  .stage-flag { top: var(--sp-2); inset-inline-start: var(--sp-2); font-size: .6875rem; }
  .stage-box::before {
    background:
      radial-gradient(120% 80% at 100% 0%, rgba(255, 255, 255, .14) 0%, transparent 55%),
      radial-gradient(circle at 50% 38%, transparent 0 48px, var(--ring) 48px 49px, transparent 49px);
  }
}

/* ---------- Teachers (photo cards) ---------- */
.teacher-card {
  position: relative; height: 100%; overflow: hidden;
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.teacher-photo { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--c-surface-2); }
.teacher-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease); }
.teacher-subject {
  position: absolute; bottom: var(--sp-3); inset-inline-start: var(--sp-3);
  background: rgba(255, 255, 255, .95); color: var(--navy-800);
  font-size: var(--fs-xs); font-weight: 700; padding: .3rem .75rem; border-radius: var(--r-pill);
  box-shadow: 0 6px 16px -8px rgba(15, 27, 51, .5);
}
[data-bs-theme="dark"] .teacher-subject { background: var(--c-surface); color: var(--gold-400); }
.teacher-body {
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: var(--sp-2) var(--sp-3); padding: var(--sp-4) var(--sp-5) var(--sp-5);
}
.teacher-body h3 { font-size: var(--fs-base); margin: 0; }
.teacher-body h3 a { color: inherit; text-decoration: none; }
.teacher-stages { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin: 0; grid-column: 1; }
.teacher-link {
  grid-column: 2; grid-row: 1 / span 2;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--c-line-strong); color: var(--c-accent-ink);
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.teacher-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.teacher-card:hover .teacher-photo img { transform: scale(1.05); }
.teacher-card:hover .teacher-link { background: var(--gold-400); border-color: var(--gold-400); color: var(--navy-900); }
.teacher-card:focus-within { outline: 3px solid var(--c-focus); outline-offset: 3px; }
.teacher-card a:focus-visible { outline: none; }
#teacherGrid > [hidden] { display: none !important; }
@media (max-width: 575.98px) {
  #teacherGrid.is-all > :nth-child(n+5) { display: none; }
  .teacher-body { padding: var(--sp-3); grid-template-columns: 1fr; }
  .teacher-body h3 { font-size: var(--fs-sm); }
  .teacher-link { display: none; }
  .teacher-subject { bottom: var(--sp-2); inset-inline-start: var(--sp-2); }
}

/* ---------- How it works: journey cards ---------- */
.section-head--wide { max-width: 760px; }
.journey {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-8);
}
.journey-step {
  position: relative; display: flex; flex-direction: column;
  padding: var(--sp-6) var(--sp-6) var(--sp-5);
  background: var(--c-surface);
  border: 1px solid var(--c-line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
/* gold accent on the top edge that widens on hover */
.journey-step::before {
  content: ""; position: absolute; top: -1px; inset-inline-start: var(--sp-6);
  width: 44px; height: 3px; border-radius: 0 0 3px 3px; background: var(--c-accent);
  transition: width var(--dur) var(--ease);
}
/* connector arrow between cards (points to the next step: left in RTL) */
.journey-step:not(:last-child)::after {
  content: ""; position: absolute; top: 46px; inset-inline-end: calc(-1 * var(--sp-8) / 2 - 14px); z-index: 1;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--c-surface) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b3862b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M15 6l-6 6 6 6'/%3e%3c/svg%3e") center / 16px no-repeat;
  border: 1px solid var(--c-line-strong);
}
.journey-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-5); }
.journey-num {
  font-size: 2.75rem; font-weight: 800; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px var(--c-line-strong);
  transition: -webkit-text-stroke-color var(--dur) var(--ease);
}
.journey-step h3 { font-size: var(--fs-md); margin-bottom: var(--sp-2); }
.journey-step p { color: var(--c-text-muted); font-size: var(--fs-sm); line-height: 1.75; margin-bottom: var(--sp-5); }
.journey-meta {
  margin-top: auto; padding-top: var(--sp-4); border-top: 1px dashed var(--c-line-strong);
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-xs); font-weight: 600; color: var(--c-accent-ink);
}
.journey-step:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--c-line-strong); }
.journey-step:hover::before { width: calc(100% - 2 * var(--sp-6)); }
.journey-step:hover .journey-num { -webkit-text-stroke-color: var(--gold-400); }

@media (max-width: 1199.98px) {
  .journey { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-6); }
  .journey-step:not(:last-child)::after { display: none; }
}
@media (max-width: 575.98px) {
  .journey { grid-template-columns: 1fr; gap: var(--sp-4); }
  .journey-step { padding: var(--sp-5); }
  .journey-step::before { inset-inline-start: var(--sp-5); }
  .journey-num { font-size: 2.25rem; }
  .section-top .btn { width: 100%; }
}

/* ---------- Activation card visual ---------- */
.gold-card-wrap { perspective: 1200px; display: flex; justify-content: center; padding: var(--sp-6) 0; }
.gold-card {
  width: min(440px, 100%); aspect-ratio: 1.586;
  border-radius: 20px; padding: clamp(1.1rem, .8rem + 1.5vw, 1.75rem);
  display: flex; flex-direction: column; justify-content: space-between;
  color: var(--c-text-inv);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(220, 175, 90, .28) 0%, transparent 46%),
    linear-gradient(150deg, #1d3765 0%, var(--navy-900) 62%);
  box-shadow: 0 30px 60px -24px rgba(15, 27, 51, .55), inset 0 0 0 1px rgba(220, 175, 90, .35);
  transform: rotate(-4deg);
  transition: transform var(--dur-slow) var(--ease);
}
.gold-card-wrap:hover .gold-card { transform: rotate(0deg) translateY(-6px); }
@media (max-width: 575.98px) {
  .gold-card { width: calc(100% - 24px); transform: rotate(-2deg); }
}
.gold-card-top { display: flex; align-items: center; justify-content: space-between; font-size: var(--fs-sm); color: var(--gold-300); }
.gold-card-top img { width: 44px; height: 44px; }
.gold-card-code { font-size: clamp(1.05rem, .8rem + 1.2vw, 1.6rem); font-weight: 600; letter-spacing: .12em; margin: 0; color: #fff; }
.gold-card-code span {
  color: transparent; border-radius: 4px;
  background: linear-gradient(110deg, #9ea6b3 20%, #d9dee6 45%, #9ea6b3 70%);
}
.gold-card-bottom { display: flex; align-items: flex-end; justify-content: space-between; font-size: var(--fs-xs); color: rgba(244, 239, 228, .7); }
.gold-card-bottom .num { font-size: var(--fs-xl); font-weight: 700; color: var(--gold-400); }
.method { padding: var(--sp-5); height: 100%; }
.method h3 { font-size: var(--fs-base); margin: var(--sp-4) 0 var(--sp-1); }
.method p { font-size: var(--fs-sm); color: var(--c-text-muted); margin: 0; }

/* ---------- Closing CTA (copy + photo) ---------- */
.cta-section { padding-bottom: var(--section-y); }
.cta-panel {
  display: grid; grid-template-columns: 1.05fr 1fr;
  background: var(--navy-800); color: rgba(244, 239, 228, .8);
  border-radius: var(--r-xl); overflow: hidden;
  box-shadow: var(--shadow-lg);
  --c-focus: var(--gold-400);
}
[data-bs-theme="dark"] .cta-panel { background: var(--c-surface-2); border: 1px solid var(--c-line); }
.cta-copy { padding: clamp(2rem, 1.2rem + 3vw, 3.5rem); }
.cta-eyebrow { color: var(--gold-400); }
.cta-eyebrow::before { background: var(--gold-400); }
.cta-copy h2 { color: #fff; font-size: var(--fs-3xl); margin-bottom: var(--sp-4); }
.cta-lead { font-size: var(--fs-md); max-width: 46ch; }
.cta-steps { list-style: none; padding: 0; margin: var(--sp-6) 0 var(--sp-8); display: grid; gap: var(--sp-3); }
.cta-steps li { display: flex; align-items: center; gap: var(--sp-3); color: #fff; font-weight: 500; }
.cta-steps .num {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  border: 1px solid rgba(220, 175, 90, .55); color: var(--gold-400);
  font-size: var(--fs-sm); font-weight: 700;
}
.cta-media { position: relative; min-height: 340px; }
.cta-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* blend the photo into the panel on the copy side */
.cta-media::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to left, var(--navy-800) 0%, rgba(23, 47, 85, 0) 30%);
}
[data-bs-theme="dark"] .cta-media::before { background: linear-gradient(to left, var(--c-surface-2) 0%, transparent 30%); }
@media (max-width: 991.98px) {
  .cta-panel { grid-template-columns: 1fr; }
  .cta-media { order: -1; min-height: 240px; }
  .cta-media::before { background: linear-gradient(to top, var(--navy-800) 0%, rgba(23, 47, 85, 0) 45%); }
  [data-bs-theme="dark"] .cta-media::before { background: linear-gradient(to top, var(--c-surface-2) 0%, transparent 45%); }
}
