/* ==========================================================================
   Science Guru Tutoring — Main Stylesheet
   Sections:
   01. Design tokens        07. Cards (features/services/steps/testimonials)
   02. Base & reset         08. CTA band
   03. Typography           09. About page
   04. Utilities & layout   10. Forms
   05. Buttons & links      11. Contact page & FAQ
   06. Header & navigation  12. Booking page
                            13. Footer
                            14. Animations, focus & motion preferences
   ========================================================================== */

/* --------------------------------------------------------------------------
   01. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand palette */
  --primary-color: #1d4ed8;
  --primary-dark: #1e3a8a;
  --primary-light: #3b82f6;
  --primary-soft: #dbeafe;
  --primary-softer: #eff6ff;

  --secondary-color: #0f766e;
  --secondary-soft: #ccfbf1;

  --accent-color: #f59e0b;
  --accent-dark: #b45309;
  --accent-soft: #fef3c7;

  /* Neutrals */
  --heading-color: #0f172a;
  --text-color: #334155;
  --text-muted: #64748b;
  --background-color: #ffffff;
  --surface-color: #f8fafc;
  --border-color: #e2e8f0;

  /* Feedback */
  --success-color: #15803d;
  --success-soft: #dcfce7;
  --error-color: #dc2626;
  --error-soft: #fee2e2;

  /* Typography */
  --font-body: "Plus Jakarta Sans", "Segoe UI", Tahoma, Arial, sans-serif;

  /* Shape & depth */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 6px 18px rgba(15, 23, 42, 0.09);
  --shadow-lg: 0 16px 40px rgba(30, 58, 138, 0.16);

  /* Layout */
  --container-max: 1160px;
  --header-height: 76px;
}

/* --------------------------------------------------------------------------
   02. Base & reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-color);
  background-color: var(--background-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
select,
textarea {
  font: inherit;
  color: inherit;
}

ul[class],
ol[class] {
  list-style: none;
  padding: 0;
}

/* Author display values must never override the hidden attribute */
[hidden] {
  display: none !important;
}

[id] {
  scroll-margin-top: calc(var(--header-height) + 16px);
}

::selection {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

/* --------------------------------------------------------------------------
   03. Typography
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4 {
  font-weight: 800;
  line-height: 1.18;
  color: var(--heading-color);
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(2.1rem, 1.35rem + 3vw, 3.25rem); }
h2 { font-size: clamp(1.65rem, 1.2rem + 2vw, 2.4rem); }
h3 { font-size: clamp(1.15rem, 1rem + 0.7vw, 1.4rem); }
h4 { font-size: 1.05rem; }

p {
  margin-block-end: 1em;
}

p:last-child {
  margin-block-end: 0;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
}

.lead {
  font-size: clamp(1.02rem, 0.98rem + 0.35vw, 1.17rem);
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   04. Utilities & layout
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 24px;
}

.section {
  padding-block: clamp(56px, 5vw + 32px, 96px);
}

.section-alt {
  background-color: var(--surface-color);
}

.section-head {
  max-width: 640px;
  margin-inline: auto;
  text-align: center;
  margin-block-end: clamp(36px, 4vw, 56px);
}

.section-eyebrow,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: var(--primary-softer);
  border: 1px solid var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-block-end: 16px;
}

.section-subtitle {
  color: var(--text-muted);
  margin-block-start: 12px;
}

.grid {
  display: grid;
  gap: 24px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 200;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: var(--primary-dark);
  color: #fff;
  font-weight: 600;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
  color: #fff;
}

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

/* --------------------------------------------------------------------------
   05. Buttons & links
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 28px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.97rem;
  line-height: 1.2;
  border: 2px solid transparent;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    transform 0.15s ease, box-shadow 0.2s ease;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--primary-color);
  color: #fff;
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.28);
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
}

.btn-outline {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: transparent;
}

.btn-outline:hover {
  background: var(--primary-softer);
  color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-light {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

.btn-light:hover {
  background: var(--primary-softer);
  color: var(--primary-dark);
}

.btn-accent {
  background: var(--accent-color);
  color: #452c04;
}

.btn-accent:hover {
  background: #dd8f09;
  color: #452c04;
}

.btn-lg {
  padding: 16px 34px;
  font-size: 1.05rem;
}

.btn-sm {
  padding: 9px 18px;
  font-size: 0.88rem;
}

.btn-block {
  width: 100%;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 0.95rem;
}

.link-arrow svg {
  width: 17px;
  height: 17px;
  transition: transform 0.2s ease;
}

.link-arrow:hover svg {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   06. Header & navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--border-color);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  height: 44px;
  width: auto;
  flex-shrink: 0;
}

.brand-type {
  height: 22px;
  width: auto;
}

@media (max-width: 519px) {
  .brand-mark { height: 38px; }
  .brand-type { height: 18px; }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  position: relative;
  display: inline-block;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.96rem;
  color: var(--text-color);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--primary-color);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

.nav-link:hover {
  color: var(--primary-color);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.nav-link.active {
  color: var(--primary-color);
}

.nav-cta { white-space: nowrap; }

/* Hamburger toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 46px;
  height: 46px;
  padding: 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: #fff;
}

.toggle-bar {
  display: block;
  width: 100%;
  height: 2.5px;
  border-radius: 2px;
  background: var(--heading-color);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .toggle-bar:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .toggle-bar:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   Hero (home page)
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--primary-softer) 0%, #fff 100%);
}

.hero::before {
  content: "";
  position: absolute;
  top: -220px;
  right: -160px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.14) 0%, transparent 68%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(36px, 5vw, 72px);
  padding-block: clamp(56px, 6vw, 104px);
}

.hero-content { max-width: 560px; }

.hero-title { margin-block-end: 20px; }

.hero-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-block-end: 30px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-block-end: 38px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
}

.stat-value {
  display: block;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--primary-color);
  line-height: 1.15;
}

.stat-label {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
}

.hero-media { position: relative; }

.hero-media img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* Page hero (interior pages) */
.page-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 62%, #2563eb 100%);
  color: #fff;
  text-align: center;
  overflow: hidden;
  position: relative;
}

.page-hero::after {
  content: "";
  position: absolute;
  inset: auto -80px -140px auto;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.page-hero-inner {
  max-width: 720px;
  margin-inline: auto;
  padding-block: clamp(56px, 5vw + 28px, 88px);
}

.page-hero h1 {
  color: #fff;
  margin-block: 14px 14px;
}

.page-hero p {
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.08rem;
}

.page-hero .eyebrow {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

/* --------------------------------------------------------------------------
   07. Cards
   -------------------------------------------------------------------------- */
.feature-card,
.service-card,
.value-card,
.step-card,
.testimonial-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.feature-card:hover,
.service-card:hover,
.value-card:hover,
.step-card:hover,
.testimonial-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-soft);
}

.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--primary-softer);
  color: var(--primary-color);
  margin-block-end: 18px;
}

.icon-badge svg {
  width: 26px;
  height: 26px;
}

.feature-card h3,
.service-card h3,
.value-card h3,
.step-card h3 {
  margin-block-end: 10px;
}

.feature-card p,
.service-card p,
.value-card p {
  color: var(--text-muted);
  font-size: 0.96rem;
  margin-block-end: 14px;
}

.service-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: #fff;
  margin-block-end: 18px;
}

.service-icon svg {
  width: 24px;
  height: 24px;
}

.card-link { white-space: nowrap; }

/* Steps */
.steps-grid {
  counter-reset: step;
}

.step-card {
  position: relative;
  text-align: center;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  margin-block-end: 18px;
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.3);
}

.step-card p {
  color: var(--text-muted);
  font-size: 0.96rem;
}

/* Testimonials */
.testimonial-card {
  display: flex;
  flex-direction: column;
}

.stars {
  display: flex;
  gap: 3px;
  color: var(--accent-color);
  margin-block-end: 16px;
}

.stars svg {
  width: 17px;
  height: 17px;
}

.testimonial-card blockquote {
  font-size: 0.99rem;
  color: var(--text-color);
  flex: 1;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-block-start: 20px;
  padding-block-start: 18px;
  border-top: 1px solid var(--border-color);
}

.author-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.author-name {
  display: block;
  font-weight: 700;
  color: var(--heading-color);
  line-height: 1.3;
}

.author-role {
  display: block;
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   08. CTA band
   -------------------------------------------------------------------------- */
.cta-band {
  background: linear-gradient(120deg, var(--primary-dark) 0%, var(--primary-color) 70%, #2f66e0 100%);
  border-radius: var(--radius-lg);
  padding: clamp(44px, 5vw, 72px) clamp(24px, 5vw, 72px);
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.cta-band::before,
.cta-band::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.cta-band::before {
  width: 240px;
  height: 240px;
  top: -110px;
  left: -70px;
}

.cta-band::after {
  width: 300px;
  height: 300px;
  bottom: -150px;
  right: -90px;
}

.cta-band h2 {
  color: #fff;
  margin-block-end: 12px;
}

.cta-band p {
  color: rgba(255, 255, 255, 0.88);
  max-width: 560px;
  margin-inline: auto;
  margin-block-end: 30px;
  font-size: 1.05rem;
}

.cta-band > * {
  position: relative;
  z-index: 1;
}

.cta-band .cta-motto {
  margin-block-end: 30px;
  font-style: italic;
  font-weight: 700;
  color: #fff;
}

/* --------------------------------------------------------------------------
   09. About page
   -------------------------------------------------------------------------- */
.story-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(36px, 5vw, 64px);
  align-items: center;
}

.story-media img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.story-content .eyebrow {
  margin-block-end: 14px;
}

.mission-callout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--primary-softer);
  border: 1px solid var(--primary-soft);
  border-radius: var(--radius-md);
  padding: 26px 28px;
  margin-block-start: 8px;
}

.mission-callout .icon-badge {
  margin-block-end: 0;
  flex-shrink: 0;
  background: #fff;
}

.mission-motto {
  margin-block-start: 14px;
  font-style: italic;
  font-weight: 700;
  color: var(--primary-color);
}

.values-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  align-items: stretch;
}

.tutors-grid {
  align-items: stretch;
  max-width: 1020px;
  margin-inline: auto;
}

.tutor-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tutor-photo {
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
  width: 100%;
}

.tutor-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.tutor-role {
  align-self: flex-start;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--secondary-color);
  background: var(--secondary-soft);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
}

.tutor-body p {
  color: var(--text-muted);
  font-size: 0.94rem;
  margin-block-start: 2px;
}

.check-list li {
  position: relative;
  padding-left: 36px;
  margin-block-end: 14px;
  color: var(--text-color);
}

.check-list svg {
  position: absolute;
  left: 0;
  top: 3px;
  width: 22px;
  height: 22px;
  color: var(--success-color);
}

.benefit-panel {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: clamp(28px, 4vw, 48px);
  box-shadow: var(--shadow-sm);
}

/* Service detail blocks (services page) */
.service-layout {
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
}

.icon-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-block-end: 16px;
}

.icon-row .icon-badge {
  margin-block-end: 0;
}

.icon-row h2 {
  margin-block: 0;
}

.service-content > p {
  color: var(--text-muted);
  margin-block-end: 20px;
}

.service-panel h3 {
  margin-block-end: 8px;
}

.service-panel p {
  color: var(--text-muted);
  font-size: 0.94rem;
  margin-block-end: 18px;
}

/* --------------------------------------------------------------------------
   10. Forms (shared)
   -------------------------------------------------------------------------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

#contact-form .btn-submit {
  margin-block-start: 20px;
}

#contact-form .btn-submit.is-hidden {
  display: none;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label {
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--heading-color);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea.form-control {
  resize: vertical;
  min-height: 140px;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.form-control.is-invalid {
  border-color: var(--error-color);
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 4px var(--error-soft);
}

.field-error {
  display: none;
  font-size: 0.83rem;
  color: var(--error-color);
  font-weight: 500;
}

.field-error.is-visible {
  display: block;
}

.form-hint {
  font-size: 0.83rem;
  color: var(--text-muted);
}

/* Fieldset used for the session-type radio cards */
fieldset.form-field {
  border: 0;
  padding: 0;
  min-width: 0;
}

fieldset.form-field legend {
  padding: 0;
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--heading-color);
}

.form-success {
  display: none;
  align-items: flex-start;
  gap: 14px;
  background: var(--success-soft);
  border: 1px solid #86efac;
  color: #14532d;
  padding: 20px 22px;
  border-radius: var(--radius-md);
}

.form-success.is-visible {
  display: flex;
}

.form-success svg {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  color: var(--success-color);
  margin-top: 2px;
}

.form-success.is-animating svg {
  transform-origin: center;
  animation: success-pop 0.55s cubic-bezier(0.22, 1.61, 0.36, 1);
}

.form-success.is-animating strong {
  animation: success-slide 0.45s ease-out;
}

@keyframes success-pop {
  0% { transform: scale(0.2) rotate(-20deg); opacity: 0; }
  60% { transform: scale(1.25) rotate(6deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); }
}

@keyframes success-slide {
  0% { transform: translateY(8px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.form-success strong {
  display: block;
  font-size: 1.02rem;
  margin-block-end: 3px;
}

/* Submit button loading state */
.btn-submit .btn-loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-submit .btn-label {
  display: inline-block;
}

.btn-submit.is-loading .btn-label {
  display: none;
}

.btn-submit.is-loading .btn-loading {
  display: flex;
}

.btn-submit.is-loading {
  cursor: wait;
  opacity: 0.8;
}

.spinner {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   404 page
   -------------------------------------------------------------------------- */
.error-page {
  text-align: center;
  padding-block: 100px 60px;
}

.error-code {
  display: block;
  font-size: clamp(7rem, 18vw, 14rem);
  font-weight: 800;
  line-height: 1;
  color: var(--primary-color);
  opacity: 0.12;
  pointer-events: none;
  user-select: none;
}

.error-page h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin-block-start: -20px;
  color: var(--heading-color);
}

.error-page p {
  max-width: 460px;
  margin-inline: auto;
  margin-block: 12px 28px;
  color: var(--text-color);
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   11. Contact page & FAQ
   -------------------------------------------------------------------------- */
.contact-layout {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(28px, 4vw, 48px);
  align-items: start;
}

.info-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 30px;
  box-shadow: var(--shadow-sm);
}

.info-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding-block: 14px;
}

.info-item + .info-item {
  border-top: 1px solid var(--border-color);
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-softer);
  color: var(--primary-color);
  flex-shrink: 0;
}

.info-icon svg {
  width: 21px;
  height: 21px;
}

.info-item strong {
  display: block;
  color: var(--heading-color);
  font-size: 0.97rem;
}

.info-item span,
.info-item a {
  font-size: 0.94rem;
  color: var(--text-muted);
}

.info-item a:hover {
  color: var(--primary-color);
}

.panel-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: clamp(28px, 4vw, 44px);
  box-shadow: var(--shadow-sm);
}

.panel-card > h2 {
  margin-block-end: 6px;
}

.panel-card > .panel-intro {
  color: var(--text-muted);
  margin-block-end: 26px;
}

/* FAQ accordion */
.faq-list {
  display: grid;
  gap: 14px;
  max-width: 780px;
  margin-inline: auto;
}

.faq-item {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.faq-item.is-open {
  border-color: var(--primary-soft);
  box-shadow: var(--shadow-md);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  text-align: left;
  padding: 19px 24px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--heading-color);
}

.faq-question:hover {
  color: var(--primary-color);
}

.faq-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary-softer);
  color: var(--primary-color);
  flex-shrink: 0;
  transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.faq-icon svg {
  width: 16px;
  height: 16px;
}

.faq-question[aria-expanded="true"] .faq-icon {
  transform: rotate(180deg);
  background: var(--primary-color);
  color: #fff;
}

.faq-panel {
  display: none;
  padding: 0 24px 20px;
  color: var(--text-muted);
  font-size: 0.96rem;
}

.faq-item.is-open .faq-panel {
  display: block;
  animation: faq-reveal 0.25s ease;
}

@keyframes faq-reveal {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   12. Booking page
   -------------------------------------------------------------------------- */
.booking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: clamp(24px, 3vw, 40px);
  align-items: start;
}

.booking-main { min-width: 0; }

/* Progress indicator */
.progress-steps {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-block-end: 28px;
}

.progress-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  position: relative;
}

.progress-step:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 17px;
  right: calc(50% + 24px);
  left: calc(-50% + 24px);
  height: 2px;
  background: var(--border-color);
  transition: background-color 0.3s ease;
}

.progress-step.is-complete::before {
  background: var(--primary-color);
}

.step-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 700;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.progress-step.is-active .step-dot {
  border-color: var(--primary-color);
  color: var(--primary-color);
  box-shadow: 0 0 0 5px var(--primary-softer);
}

.progress-step.is-complete .step-dot {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.step-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.3;
}

.progress-step.is-active .step-label {
  color: var(--primary-dark);
}

/* Wizard panels */
.wizard-panel {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: clamp(24px, 3.5vw, 40px);
  box-shadow: var(--shadow-sm);
}

.wizard-step[hidden] {
  display: none;
}

.wizard-step:not([hidden]) {
  animation: step-in 0.3s ease;
}

@keyframes step-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wizard-step > h2 {
  font-size: 1.35rem;
  margin-block-end: 4px;
}

.wizard-step > .wizard-intro {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-block-end: 22px;
}

/* Selectable option cards (subjects & tutors) */
.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.option-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.option-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

.option-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-card.is-selected {
  border-color: var(--primary-color);
  background: var(--primary-softer);
}

.option-card:focus-within {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}

.option-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
}

.option-check svg {
  width: 12px;
  height: 12px;
}

.option-card.is-selected .option-check {
  display: inline-flex;
}

.option-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--primary-softer);
  color: var(--primary-color);
  margin-block-end: 10px;
}

.option-icon svg {
  width: 21px;
  height: 21px;
}

.option-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0.9rem;
  font-weight: 800;
  margin-block-end: 10px;
}

.option-title {
  font-weight: 700;
  color: var(--heading-color);
  font-size: 0.98rem;
}

.option-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Live scheduler embed (Calendly).
   Sizing is owned by js/calendly.js: it starts the frame at a sane height
   and then pins it to exact pixel heights reported by the Calendly iframe.
   These rules only provide width behaviour and a pre-load floor. */
.calendly-embed {
  min-height: 420px;
}

.calendly-embed .calendly-inline-widget,
.calendly-embed iframe {
  display: block;
  width: 100%;
}

.slot-empty {
  margin-block-start: 16px;
  padding: 18px;
  border-radius: var(--radius-sm);
  background: var(--surface-color);
  border: 1px dashed var(--border-color);
  color: var(--text-muted);
  font-size: 0.93rem;
  text-align: center;
}

/* Demo notice */
.demo-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--accent-soft);
  border: 1px solid #fcd34d;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.87rem;
  color: #713f12;
  margin-block-start: 24px;
}

.demo-note svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--accent-dark);
}

/* Summary sidebar */
.booking-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 20px);
}

.summary-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}

.summary-card h2 {
  font-size: 1.12rem;
  margin-block-end: 16px;
}

.summary-list {
  display: grid;
  gap: 0;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-block: 11px;
  font-size: 0.93rem;
}

.summary-row + .summary-row {
  border-top: 1px solid var(--border-color);
}

.summary-row dt {
  color: var(--text-muted);
  flex-shrink: 0;
}

.summary-row dd {
  font-weight: 700;
  color: var(--heading-color);
  text-align: right;
}

.summary-row dd.placeholder {
  font-weight: 500;
  color: #cbd5e1;
}

.summary-total {
  margin-block-start: 14px;
  padding-block-start: 14px;
  border-top: 2px dashed var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.summary-total strong {
  color: var(--heading-color);
}

/* Wizard footer actions */
.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-block-start: 28px;
  padding-block-start: 24px;
  border-top: 1px solid var(--border-color);
}

.wizard-actions .spacer {
  flex: 1;
}

.step-error {
  display: none;
  color: var(--error-color);
  font-size: 0.88rem;
  font-weight: 600;
}

.step-error.is-visible {
  display: block;
}

/* --------------------------------------------------------------------------
   13. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--heading-color);
  color: #cbd5e1;
  margin-block-start: auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: clamp(28px, 4vw, 56px);
  padding-block: clamp(48px, 5vw, 72px) 40px;
}

.footer-brand .brand {
  margin-block-end: 16px;
}

.footer-about {
  font-size: 0.93rem;
  max-width: 300px;
}

.footer-heading {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-block-end: 18px;
}

.footer-links li {
  margin-block-end: 10px;
}

.footer-links a {
  color: #cbd5e1;
  font-size: 0.94rem;
}

.footer-links a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-contact li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-block-end: 13px;
  font-size: 0.93rem;
}

.footer-contact svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--accent-color);
  margin-top: 3px;
}

.footer-contact a {
  color: #cbd5e1;
}

.footer-contact a:hover {
  color: #fff;
}

.social-links {
  display: flex;
  gap: 10px;
  margin-block-start: 20px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.social-link:hover {
  background: var(--primary-color);
  color: #fff;
  transform: translateY(-3px);
}

.social-link svg {
  width: 18px;
  height: 18px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-block: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.87rem;
}

.footer-bottom p {
  margin: 0;
}

.footer-bottom nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-bottom nav a {
  color: #cbd5e1;
}

.footer-bottom nav a:hover {
  color: #fff;
}

/* --------------------------------------------------------------------------
   14. Animations, reveal effects, focus & motion preferences
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].revealed {
  opacity: 1;
  transform: none;
}

.delay-1 { transition-delay: 0.08s; }
.delay-2 { transition-delay: 0.16s; }
.delay-3 { transition-delay: 0.24s; }
.delay-4 { transition-delay: 0.32s; }

:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Responsive breakpoints
   -------------------------------------------------------------------------- */

/* Large desktop */
@media (min-width: 1440px) {
  :root {
    --container-max: 1240px;
  }
}

/* Desktop -> small laptop */
@media (max-width: 1199px) {
  .hero-inner {
    grid-template-columns: 1fr 1fr;
  }
}

/* Tablet landscape & below: collapse navigation */
@media (max-width: 991px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 18px 24px 24px;
    display: none;
  }

  .site-nav.is-open {
    display: flex;
    animation: nav-drop 0.25s ease;
  }

  @keyframes nav-drop {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .nav-link {
    display: block;
    padding: 12px 14px;
    font-size: 1rem;
  }

  .nav-link::after {
    display: none;
  }

  .nav-link.active {
    background: var(--primary-softer);
  }

  .nav-cta {
    justify-content: center;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content {
    max-width: 620px;
    margin-inline: auto;
  }

  .hero-actions,
  .hero-stats {
    justify-content: center;
  }

  .story-grid {
    grid-template-columns: 1fr;
  }

  .service-layout {
    grid-template-columns: 1fr;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }

  .booking-layout {
    grid-template-columns: 1fr;
  }

  .booking-sidebar {
    position: static;
    order: -1;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
  }
}

/* Tablet portrait & mobile */
@media (max-width: 767px) {
  .container {
    padding-inline: 18px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .progress-steps {
    flex-wrap: nowrap;
  }

  .step-label {
    display: none;
  }

  .progress-step.is-active .step-label {
    display: block;
    position: absolute;
    top: 44px;
    white-space: nowrap;
  }

  .progress-steps {
    margin-block-end: 44px;
  }

  .cta-band .btn {
    width: 100%;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .wizard-actions {
    flex-wrap: wrap;
  }

  .wizard-actions .btn {
    flex: 1 1 auto;
  }
}

/* Small mobile */
@media (max-width: 519px) {
  .hero-actions .btn {
    width: 100%;
  }

  .footer-top {
    grid-template-columns: 1fr;
  }

  .mission-callout {
    flex-direction: column;
  }
}

/* --------------------------------------------------------------------------
   14. Back to top
   -------------------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  right: clamp(16px, 3vw, 28px);
  bottom: clamp(16px, 3vw, 28px);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--primary-color);
  color: #fff;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s ease,
    background-color 0.2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-dark);
}

.back-to-top:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}

.back-to-top svg {
  width: 22px;
  height: 22px;
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition: none;
    transform: none;
  }
}