/* ==========================================================================
   BM English School - styles for the new sections & features
   (loader, cursor trail, 3D pillars, teachers, journey, quiz, FAQ, call button)
   ========================================================================== */

/* ---------- Intro loader ---------- */
.fx-loader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, #FFFFFF 0%, #FFF1E4 100%);
  transition: opacity 0.7s ease, visibility 0.7s ease, transform 0.9s cubic-bezier(0.7, 0, 0.2, 1);
  /* CSS-only safety net: disappears even if JS fails */
  animation: fxLoaderOut 0.6s ease 4.5s forwards;
}

.fx-loader.fx-done {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.15);
  pointer-events: none;
}

@keyframes fxLoaderOut { to { opacity: 0; visibility: hidden; } }

.fx-loader-inner { text-align: center; }

.fx-loader-cube {
  width: 70px;
  height: 70px;
  margin: 0 auto 2.2rem;
  position: relative;
  transform-style: preserve-3d;
  animation: fxCube 2.4s linear infinite;
}

.fx-loader-cube i {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #FF5A00, #FF9A3C);
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.35);
  opacity: 0.92;
}

.fx-loader-cube i:nth-child(1) { transform: translateZ(35px); }
.fx-loader-cube i:nth-child(2) { transform: rotateY(180deg) translateZ(35px); }
.fx-loader-cube i:nth-child(3) { transform: rotateY(90deg) translateZ(35px); }
.fx-loader-cube i:nth-child(4) { transform: rotateY(-90deg) translateZ(35px); }
.fx-loader-cube i:nth-child(5) { transform: rotateX(90deg) translateZ(35px); }
.fx-loader-cube i:nth-child(6) { transform: rotateX(-90deg) translateZ(35px); }

@keyframes fxCube {
  from { transform: rotateX(-25deg) rotateY(0deg); }
  to { transform: rotateX(-25deg) rotateY(360deg); }
}

.fx-loader-text {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.5rem;
  color: #0F172A;
}

.fx-loader-text span { color: #FF5A00; }

.fx-loader-bar {
  width: 180px;
  height: 4px;
  margin: 1rem auto 0;
  border-radius: 9999px;
  background: rgba(255, 90, 0, 0.15);
  overflow: hidden;
}

.fx-loader-bar span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, #FF5A00, #FF9A3C);
  animation: fxBar 1.1s ease-in-out infinite;
}

@keyframes fxBar {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(260%); }
}

/* ---------- Cursor trail ---------- */
.fx-trail {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

.fx-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  border: 2px solid rgba(255, 90, 0, 0.55);
  pointer-events: none;
  z-index: 1001;
  transition: width 0.25s ease, height 0.25s ease, margin 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.fx-cursor.fx-cursor-big {
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  background: rgba(255, 90, 0, 0.12);
  border-color: rgba(255, 90, 0, 0.9);
}

/* ---------- Video poster backdrop ---------- */
.video-blur-backdrop {
  background-size: cover;
  background-position: center;
}

/* ---------- 3D pillars ---------- */
.pillars {
  --full: clamp(150px, 26vw, 270px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  align-items: end;
  max-width: 900px;
  margin: 3rem auto 0;
  perspective: 1200px;
}

.pillar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 3px solid rgba(255, 90, 0, 0.25);
}

.pillar-value {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(1.7rem, 5vw, 3rem);
  color: #0F172A;
  line-height: 1;
}

.pillar-value small {
  font-size: 0.45em;
  color: var(--color-text-muted);
  font-weight: 700;
  margin-left: 0.15em;
}

.pillar-num {
  background: linear-gradient(180deg, #FF5A00, #FF8A00);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.pillar-bar {
  --w: clamp(56px, 12vw, 96px);
  --d: clamp(28px, 6vw, 48px);
  position: relative;
  width: var(--w);
  height: 0;
  transform-style: preserve-3d;
  transform: rotateX(-14deg) rotateY(-30deg);
  transition: height 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.pillar.fx-in .pillar-bar { height: calc(var(--full) * var(--fill, 0.9)); }

.pillar-face { position: absolute; }

.pillar-face.front {
  inset: 0;
  background: linear-gradient(180deg, #FF8A00 0%, #FF5A00 100%);
  border-radius: 4px 4px 0 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.pillar-face.side {
  top: 0;
  right: 0;
  width: var(--d);
  height: 100%;
  transform-origin: right center;
  transform: rotateY(90deg);
  background: linear-gradient(180deg, #E04E00, #B83C00);
}

.pillar-face.top {
  top: 0;
  left: 0;
  width: 100%;
  height: var(--d);
  transform-origin: center top;
  transform: rotateX(90deg);
  background: linear-gradient(135deg, #FFD0A3, #FFB36B);
}

.pillar-label {
  font-weight: 800;
  font-size: 0.85rem;
  text-align: center;
  color: var(--color-text-muted);
  max-width: 180px;
}

/* ---------- Teachers ---------- */
.teacher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  perspective: 1400px;
  max-width: 1100px;
  margin: 2.5rem auto 0;
}

.teacher-card {
  position: relative;
  background: linear-gradient(165deg, #FFFFFF 50%, var(--fx-cream) 100%);
  border: 1px solid rgba(255, 90, 0, 0.2);
  border-radius: 24px;
  padding: 2.25rem 1.25rem 1.5rem;
  text-align: center;
  box-shadow: 0 25px 50px -25px rgba(255, 90, 0, 0.4);
  overflow: hidden;
  transform-style: preserve-3d;
}

.teacher-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, #FF5A00, #FF9A3C);
}

.teacher-coin {
  width: 92px;
  height: 92px;
  margin: 0 auto 1.1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.9rem;
  color: #FFFFFF;
  background: radial-gradient(circle at 30% 25%, #FFB36B 0%, #FF5A00 60%, #C94400 100%);
  box-shadow: 0 18px 30px -8px rgba(255, 90, 0, 0.6), inset 0 -6px 14px rgba(120, 30, 0, 0.35), inset 0 4px 8px rgba(255, 255, 255, 0.5);
  transform: translateZ(40px);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.teacher-card:hover .teacher-coin { transform: translateZ(40px) rotateY(360deg); }

.teacher-name {
  font-size: 1.1rem;
  font-weight: 900;
  color: #0F172A;
  transform: translateZ(25px);
}

.teacher-role {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin: 0.25rem 0 1rem;
  font-weight: 600;
}

.teacher-score {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  background: rgba(255, 90, 0, 0.1);
  border: 1px solid rgba(255, 90, 0, 0.25);
  transform: translateZ(30px);
}

.teacher-score small { font-weight: 800; font-size: 0.7rem; color: #E04E00; letter-spacing: 0.08em; }
.teacher-score b { font-family: var(--font-heading); font-weight: 900; font-size: 1.35rem; color: #FF5A00; }

/* ---------- Journey ---------- */
.journey {
  position: relative;
  max-width: 1000px;
  margin: 3rem auto 0;
  display: grid;
  gap: 2rem;
}

.journey-line {
  position: absolute;
  left: 31px;
  top: 20px;
  bottom: 20px;
  width: 4px;
  border-radius: 9999px;
  background: rgba(255, 90, 0, 0.15);
}

.journey-line-fill {
  width: 100%;
  height: 0%;
  border-radius: inherit;
  background: linear-gradient(180deg, #FF5A00, #FF9A3C);
  box-shadow: 0 0 14px rgba(255, 90, 0, 0.6);
}

.journey-step {
  position: relative;
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 1.25rem;
  align-items: center;
  perspective: 1000px;
}

.journey-node {
  position: relative;
  width: 66px;
  height: 66px;
  border-radius: 20px;
  background: #FFFFFF;
  border: 2px solid rgba(255, 90, 0, 0.35);
  color: #FF5A00;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  box-shadow: 0 14px 28px -10px rgba(255, 90, 0, 0.5);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.journey-node .material-symbols-outlined { font-size: 1.9rem; }

.journey-node em {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0F172A;
  color: #FFFFFF;
  font-style: normal;
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.journey-step.fx-active .journey-node {
  background: linear-gradient(135deg, #FF5A00, #FF8A00);
  color: #FFFFFF;
  border-color: transparent;
  transform: rotateY(360deg) scale(1.08);
}

.journey-card {
  background: linear-gradient(160deg, #FFFFFF 55%, var(--fx-cream) 100%);
  border: 1px solid rgba(255, 90, 0, 0.18);
  border-radius: 20px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 20px 40px -22px rgba(255, 90, 0, 0.4);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.journey-step.fx-active .journey-card { transform: translateX(6px); }
.journey-card h3 { font-size: 1.15rem; font-weight: 900; margin-bottom: 0.3rem; }
.journey-card p { color: var(--color-text-muted); font-size: 0.95rem; }

@media (min-width: 900px) {
  .journey { grid-template-columns: 1fr 1fr; gap: 2.5rem 3.5rem; }
  .journey-line { display: none; }
}

/* ---------- Quiz ---------- */
.quiz-card {
  max-width: 760px;
  margin: 2rem auto 0;
  background: #FFFFFF;
  border: 1px solid rgba(255, 90, 0, 0.22);
  border-radius: 28px;
  padding: 2rem;
  box-shadow: 0 40px 80px -35px rgba(255, 90, 0, 0.5);
}

.quiz-progress {
  height: 6px;
  border-radius: 9999px;
  background: rgba(255, 90, 0, 0.12);
  overflow: hidden;
  margin-bottom: 1rem;
}

.quiz-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #FF5A00, #FF9A3C);
  border-radius: inherit;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.quiz-step-label {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.quiz-step-label b { color: #FF5A00; }

.quiz-panel { display: none; }
.quiz-panel.active { display: block; animation: fxQuizIn 0.55s cubic-bezier(0.16, 1, 0.3, 1); }

@keyframes fxQuizIn {
  from { opacity: 0; transform: perspective(900px) rotateY(-18deg) translateX(30px); }
  to { opacity: 1; transform: none; }
}

.quiz-question {
  font-size: clamp(1.25rem, 3.5vw, 1.7rem);
  font-weight: 900;
  margin-bottom: 1.25rem;
}

.quiz-options { display: grid; gap: 0.75rem; }

.quiz-option {
  text-align: left;
  padding: 1rem 1.25rem;
  border-radius: 16px;
  background: var(--fx-cream);
  border: 2px solid rgba(255, 90, 0, 0.15);
  font-weight: 700;
  font-size: 1rem;
  color: #0F172A;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.quiz-option:hover,
.quiz-option:focus-visible {
  border-color: #FF5A00;
  background: #FFFFFF;
  transform: translateX(6px);
  box-shadow: 0 10px 24px -10px rgba(255, 90, 0, 0.5);
  outline: none;
}

.quiz-result { text-align: center; }

.quiz-result-label {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #E04E00;
}

.quiz-result-title {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 900;
  margin: 0.4rem 0 0.75rem;
  background: linear-gradient(100deg, #E04E00, #FF8A00);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.quiz-result-desc { color: var(--color-text-muted); max-width: 520px; margin: 0 auto 1rem; }

.quiz-result-note {
  max-width: 520px;
  margin: 0 auto 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(255, 90, 0, 0.08);
  border-left: 4px solid #FF5A00;
  font-size: 0.9rem;
  text-align: left;
}

.quiz-result-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 800px; margin: 2rem auto 0; display: grid; gap: 0.9rem; }

.faq-item {
  background: #FFFFFF;
  border: 1px solid rgba(255, 90, 0, 0.18);
  border-radius: 18px;
  box-shadow: 0 14px 30px -20px rgba(255, 90, 0, 0.4);
  overflow: hidden;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.faq-item[open] { border-color: #FF5A00; box-shadow: 0 20px 40px -20px rgba(255, 90, 0, 0.5); }

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1.1rem 1.4rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary i {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 90, 0, 0.1);
  color: #FF5A00;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s ease, background 0.35s ease, color 0.35s ease;
}

.faq-item[open] summary i { transform: rotate(135deg); background: #FF5A00; color: #FFFFFF; }
.faq-item p { padding: 0 1.4rem 1.2rem; color: var(--color-text-muted); animation: fxQuizIn 0.4s ease; }

@media (max-width: 640px) {
  .quiz-card { padding: 1.25rem; }
  .journey-step { grid-template-columns: 54px 1fr; gap: 1rem; }
  .journey-node { width: 54px; height: 54px; border-radius: 16px; }
  .journey-line { left: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  .fx-loader-cube, .fx-loader-bar span { animation: none !important; }
  .pillar-bar { transition: none; }
}

/* ---------- Header fit with the extra nav item ---------- */
.logo-text { white-space: nowrap; }
.nav-links { gap: 1.1rem; }
@media (min-width: 1280px) { .nav-links { gap: 1.6rem; } }
@media (min-width: 1024px) and (max-width: 1199px) { .nav-links li:last-child { display: none; } }
.section-header .section-title { display: block; }
@media (max-width: 767px) { .fx-hero-canvas { opacity: 0.45; } }
