:root {
  /* Layout */
  --container: 1120px;
  --radius: 16px;

  /* Palette */
  --color-primary: #2A2D6A;             /* Deep Indigo */
  --color-accent: #297CFF;              /* Electric Blue (links, focus) */
  --color-important: #F5A623;           /* Soft Amber (CTA/base action) */
  --color-important-hover: #E4941D;     /* Darker Amber (hover) */
  --color-secondary: #5A6270;           /* Slate Gray */
  --color-success: #00B383;             /* Emerald Green */
  --color-warning: #F5A623;             /* Soft Amber (alerts) */
  --color-bg: #FDFDFD;                  /* Snow White */
  --color-muted: #555555;               /* Muted text */

  /* Effects & Motion */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.06);
  --ring-accent: 0 0 0 4px rgba(41,124,255,0.12);
  --trans-fast: .15s ease;
  --trans-med: .25s ease;
}

strong {
  color: var(--color-primary);
}

/* =========================================================
   Reset / Base
   ========================================================= */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

body {
  margin: 8px;
  padding-top: 70px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  line-height: 1.55;
  color: var(--color-secondary);
  background: var(--color-bg);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Fix for all SVGs - ensure they don't exceed their containers */
svg {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.container {
  width: min(100%, var(--container));
  margin-inline: auto;
  padding-inline: 16px;
}

.section {
  padding: 3rem 1rem;
}

/* =========================================================
   Typography
   ========================================================= */
h1, h2, h3 {
  line-height: 1.2;
  margin: 0 0 10px;
  color: var(--color-primary);
}

h1 {
  font-size: clamp(28px, 5vw, 44px);
}

h2 {
  font-size: clamp(22px, 3.2vw, 32px);
  margin-bottom: 16px;
}

h3 {
  font-size: 18px;
}

.lead {
  color: var(--color-secondary);
  font-size: clamp(16px, 2.4vw, 18px);
}

.muted {
  color: var(--color-muted);
}

small {
  font-size: 12px;
}

/* =========================================================
   Header / Navigation
   ========================================================= */
header {
  position: fixed;
  inset: 0 0 auto 0;
  height: 70px;
  z-index: 1000;
  display: flex;
  padding: 1rem 0;
  background: #fff;
  border-bottom: 1px solid #eee;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.brand .logo {
  height: 150px;
  width: auto;
  max-height: 150px; /* Ensure it doesn't exceed container */
}

/* Top-level nav group (links + CTA) */
.nav-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Links */
header nav a {
  position: relative;
  padding-bottom: 2px;
  color: var(--color-primary);
  transition: color var(--trans-med);
}

header nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0%;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--trans-med);
}

header nav a:hover {
  color: var(--color-accent);
}

header nav a:hover::after {
  width: 100%;
}

/* Nav CTA (button-like link) — stays amber on hover */
header .nav-cta {
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 600;
  color: #fff !important;
  background-color: var(--color-important);
  transition: background-color var(--trans-med), transform .2s ease;
}

header .nav-cta:hover {
  background-color: var(--color-important-hover);
  transform: translateY(-1px);
}

/* disable underline animation for CTA */
header nav a.nav-cta::after {
  display: none;
}

/* Hamburger */
.hamburger {
  position: relative;
  width: 30px;
  height: 20px; /* used in X translation */
  background: none;
  border: none;
  cursor: pointer;
  display: none; /* shown on mobile */
  z-index: 1100;
  padding: 0;
}

.hamburger span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--color-primary);
  border-radius: 2px;
  transform-origin: center;
  transition: transform var(--trans-med), opacity var(--trans-med);
}

.hamburger span:nth-child(1) {
  top: 0;
}

.hamburger span:nth-child(2) {
  top: 50%;
  transform: translateY(-50%);
}

.hamburger span:nth-child(3) {
  bottom: 0;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(8.5px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-8.5px) rotate(-45deg);
}

/* Mobile Nav */
@media (max-width: 768px) {
  .hamburger {
    display: inline-block;
    margin-left: auto;
  }

  .nav-group {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background: #fff;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    transition: left .3s ease;
    z-index: 1000;
  }

  .nav-group.open {
    left: 0;
  }

  header nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  header nav a {
    font-size: 1.1rem;
    padding: .5rem 1rem;
  }
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 600;
  text-align: center;
  background: #fff;
  color: inherit;
  border: 1.5px solid transparent;
  transition: background-color var(--trans-fast), color var(--trans-fast), transform var(--trans-fast);
  cursor: pointer;
}

.btn.block {
  width: 100%;
}

/* Primary — amber and stays amber on hover */
.btn.primary {
  border: none;
  background: var(--color-important);
  color: #fff;
}

.btn.primary:hover {
  background: var(--color-important-hover);
  transform: translateY(-1px);
}

.btn.primary:disabled {
  opacity: .7;
  cursor: not-allowed;
}

/* Ghost — outline in amber */
.btn.ghost {
  background: transparent;
  color: var(--color-important);
  border-color: var(--color-important);
}

.btn.ghost:hover {
  background: rgba(245,166,35,0.08);
}

/* Loading (toggle .loading) */
.btn.primary.loading {
  position: relative;
  pointer-events: none;
}

.btn.primary.loading::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  border-right-color: transparent;
  transform: translateY(-50%);
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

/* =========================================================
   Pills
   ========================================================= */
.pill {
  display: inline-block;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--color-secondary);
  background: #fafafa;
  color: var(--color-secondary);
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  padding-top: 64px;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.hero-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero-header .hero-text {
  flex: 2 1 400px;
}

.hero-header .small-hero-image {
  flex: 1 1 250px;
  text-align: center;
}

.hero-header .small-hero-image img {
  width: 100%;
  max-width: 400px;
  height: auto;
}

/* Mobile stack for hero */
@media (max-width: 768px) {
  .container {
    padding-inline: 5px;
  }

  .hero-header {
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 0.5rem; /* small space between all children */
  }

  .hero-header .hero-text {
    order: 1;
    flex: 0 1 auto; /* grow=0, shrink=1, basis=auto */
    height: auto;   /* collapse to content height */
  }

  .hero-header .small-hero-image {
    order: 2;
    margin-top: 2rem;
    margin-bottom: 0.25rem;
    flex: 0 0 auto;   /* No minimum size */
  }

  .hero-text {
    display: flex;
    flex-direction: column;
  }

  .hero-text h1,
  .hero-text .lead,
  .hero-text .hero-ctas {
    margin: 0;
  }

  .hero-text h1 {
    margin-top: 0.5rem; /* space after the pill */
  }

  .hero-text h1 + .lead,
  .hero-text .lead + .hero-ctas {
    margin-top: 2rem; /* consistent gap */
  }

  .hero-ctas {
    margin-bottom: 0; /* no extra space below CTA */
    margin-top: 8px;
    gap: 8px;
    justify-content: center;
  }

  /* Reduce hero bottom padding so KPI comes closer */
  .hero {
    padding-bottom: 1rem;
    padding-top: 20px;
  }

  header {
    height: 56px;
    padding: 8px 0;
  }

  body {
    padding-top: 56px;
  }

  .brand .logo {
    height: 100px; /* keeps presence while not dominating */
    max-height: 100px;
  }

  /* Hero spacing + typography */
  h1 {
    margin: 8px 0 6px;
    font-size: clamp(22px, 6vw, 30px);
  }

  .lead {
    font-size: 15px;
    line-height: 1.45;
    margin: 6px 0 10px;
  }

  /* CTA size */
  .btn.primary {
    padding: 10px 14px;
    border-radius: 10px;
  }

  .hero-ctas small {
    flex-basis: 100%;
    order: 2;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;            /* stay on one line */
    overflow: hidden;
    text-overflow: ellipsis;        /* if very long, ellipsize */
    text-align: center;
  }

  .pill {
    display: inline-block;
    font-size: 9px;
    padding: 5px 10px;
    border-width: 1px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* =========================================================
   KPI / Progress
   ========================================================= */
.kpi-wrap {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* Change from center text to horizontal layout */
.kpi {
  flex: 1 1 200px;
  display: flex;
  align-items: center;
  gap: 12px; /* space between icon and text */
  background: #fff;
  border: 1px solid #eee;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  text-align: left; /* align text properly */
}

.kpi-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  width: 32px; /* Fixed width for consistency */
  height: 32px; /* Fixed height for consistency */
}

/* Ensure SVGs in KPI icons are properly sized */
.kpi-icon svg {
  width: 24px;
  height: 24px;
  max-width: 24px;
  max-height: 24px;
}

.kpi-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-text strong {
  font-size: 18px;
  color: var(--color-primary);
}

.track {
  width: 100%;
  height: 8px;
  background: #eee;
  border-radius: 999px;
  margin: 8px 0;
  overflow: hidden;
  position: relative;
}

.bar {
  height: 100%;
  background: var(--color-success);
}

/* =========================================================
   Cards & Grids
   ========================================================= */
.grid {
  display: grid;
  gap: 16px;
}

.cards {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  border: 1px solid #eaeaea;
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* Soften text color inside USP cards */
#usps .card {
  color: var(--color-secondary);
}

/* Keep headings bold & primary */
#usps .card h3 {
  color: var(--color-primary);
}

/* Keep strong text darker for emphasis */
#usps .card strong {
  color: var(--color-primary);
}

.usp-card {
  padding-top: 24px;
  position: relative;
}

.usp-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.usp-card .usp-icon {
  margin: 0;
  flex-shrink: 0;
}

.usp-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

/* Ensure SVGs in USP icons are properly sized */
.usp-icon svg {
  width: 24px;
  height: 24px;
  max-width: 24px;
  max-height: 24px;
}

.usp-icon.student {
  background: rgba(41, 124, 255, 0.08); /* Accent blue tint */
  color: var(--color-accent);
}

.usp-icon.tutor {
  background: rgba(245, 166, 35, 0.1); /* Amber tint */
  color: var(--color-important);
}

.usp-list {
  list-style: none; /* remove default bullets */
  padding: 0;
  margin: 0;
}

.usp-list li {
  position: relative;
  padding-left: 28px; /* space for icon */
  margin-bottom: 10px;
}

.usp-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-important);
}

.usp-list-student li::before {
  background-color: var(--color-accent);
}

.usp-list-tutor li::before {
  background-color: var(--color-important);
}

#usps h2 {
  font-size: clamp(24px, 3vw, 32px);
  position: relative;
  padding-bottom: 8px;
}

#usps h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 60px;
  height: 4px;
  background: var(--color-accent);
  border-radius: 2px;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(245,166,35,0.1); /* soft amber */
  color: var(--color-important);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.card-icon svg {
  width: 24px;
  height: 24px;
  max-width: 24px;
  max-height: 24px;
  stroke-width: 2;
  display: block; /* removes any inline gap */
}

#why-join h3 {
  margin-top: 0;
}

#why-join p {
  margin: 0;
}

#why-join h2 {
  font-size: clamp(24px, 3vw, 32px);
  position: relative;
  padding-bottom: 8px;
}

#why-join h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 60px;
  height: 4px;
  background: var(--color-important);
  border-radius: 2px;
}

/* Style How Early Access Works heading */
#how h2 {
  font-size: clamp(24px, 3vw, 32px);
  position: relative;
  padding-bottom: 8px;
}

#how h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 60px;
  height: 4px;
  background: var(--color-accent);
  border-radius: 2px;
}

/* Step list with styled numbers */
#how ol {
  counter-reset: step-counter;
  list-style: none;
  padding: 0;
}

#how ol li {
  counter-increment: step-counter;
  position: relative;
  padding-left: 50px; /* room for number badge */
}

#how ol li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--color-accent);
  color: #fff;
  font-weight: bold;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Section heading */
#proof h2 {
  font-size: clamp(24px, 3vw, 32px);
  position: relative;
  padding-bottom: 8px;
}

#proof h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 60px;
  height: 4px;
  background: var(--color-important);
  border-radius: 2px;
}

/* CRITICAL FIX: Constrain SVGs in proof section card icons */
#proof .card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(245,166,35,0.1);
  color: var(--color-important);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  flex-shrink: 0;
}

#proof .card-icon svg {
  width: 24px !important;
  height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  stroke-width: 2;
  display: block;
}

/* =========================================================
   Signup / Forms
   ========================================================= */
.signup-container {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}

.signup-container h2 {
  margin-bottom: 6px;
}

.signup-container p {
  margin-bottom: 20px;
}

#signup h2 {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
  position: relative;
  display: inline-block; /* so underline matches text width */
}

#signup h2::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -6px;
  width: 60px;
  height: 4px;
  background: var(--color-important);
  border-radius: 2px;
}

/* Role toggle (legacy radios styled as buttons) */
.role-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.role-buttons input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.role-buttons label {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--color-important);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--trans-med);
}

.role-buttons input[type="radio"]:checked + label {
  background: var(--color-important);
  color: #fff;
}

.role-buttons label:hover {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

/* Form Card */
.form-card {
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 16px;
}

/* Fields */
.field {
  display: grid;
  gap: 8px;
  text-align: left;
}

.label {
  font-weight: 600;
  color: var(--color-primary);
}

/* Inputs */
.input {
  width: 100%;
  height: 48px;
  padding: 12px 14px;
  border: 1.5px solid #D9DDE3;
  border-radius: 12px;
  background: #fff;
  color: var(--color-secondary);
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast), background-color var(--trans-fast);
}

.input::placeholder {
  color: #9AA1AA;
}

.input:hover {
  border-color: #C9CFD8;
}

.input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--ring-accent);
}

/* Validation (toggle .is-invalid / .is-valid) */
.input.is-invalid {
  border-color: #E55353;
}

.input.is-invalid:focus {
  box-shadow: 0 0 0 4px rgba(229,83,83,0.16);
}

.input.is-valid {
  border-color: var(--color-success);
}

/* Segmented control */
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.segmented input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-btn {
  display: inline-block;
  text-align: center;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid #D9DDE3;
  background: #fff;
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.segmented-btn:hover {
  border-color: var(--color-important);
  color: var(--color-important);
}

input[type="radio"]:focus + .segmented-btn {
  box-shadow: var(--ring-accent);
}

input[type="radio"]:checked + .segmented-btn {
  background: var(--color-important);
  border-color: var(--color-important);
  color: #fff;
}

/* Microcopy */
.microcopy {
  display: block;
  margin-top: -4px;
}

/* Small screens for forms */
@media (max-width: 480px) {
  .form-card {
    padding: 16px;
    border-radius: 14px;
  }

  .segmented-btn {
    padding: 10px 12px;
  }
}

/* =========================================================
   Animations
   ========================================================= */
.card, .kpi, .hero-ctas, h2 {
  opacity: 0;
  transform: translateY(20px);
  transition: all .5s ease-out;
}

.card.visible, .kpi.visible, .hero-ctas.visible, h2.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid #eee;
  padding: 24px 0;
  color: var(--color-muted);
}

.site-footer a {
  text-decoration: underline;
}