:root {
  --background: #ffffff;
  --foreground: #16181d;
  --primary: #1a5d3a;
  --primary-hover: #144b2e;
  --primary-foreground: #ffffff;
  --primary-soft: #e8f4ee;
  --primary-ring: rgba(26, 93, 58, 0.2);
  --muted: #f4f5f7;
  --muted-foreground: #6b7280;
  --border: #e5e7eb;
  --surface: #fafbfc;
  --destructive: #dc2626;
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.04), 0 24px 70px rgba(0, 0, 0, 0.12);
  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  border-color: var(--border);
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  line-height: 1.5;
}

body.modal-open {
  overflow: hidden;
}

h1,
h2,
h3 {
  font-family: var(--font-sans);
  letter-spacing: -0.03em;
  font-weight: 800;
}

/* Exact apply.newfans.com page structure & spacing */
.page-shell {
  min-height: 100vh;
  background-color: var(--background);
}

.site-header {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 0;
}

.brand-logo {
  display: block;
  height: 28px;
  width: auto;
}

.main-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

/* 1. Qualifier + Headline + Sub Copy */
.hero-section {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  margin: 0 auto;
  border-radius: 8px;
  background-color: var(--primary-soft);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.375;
  letter-spacing: -0.025em;
  color: var(--foreground);
}

.eyebrow-accent,
.headline-accent {
  color: var(--primary);
}

.headline {
  margin: 20px 0 0;
  font-size: 26px;
  line-height: 1.2;
  color: var(--foreground);
}

.subcopy {
  max-width: 620px;
  margin: 24px auto 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  color: #2c313a;
  text-wrap: pretty;
}

/* 2. VSL + Matched-Width CTA */
.vsl-section {
  max-width: 720px;
  margin: 32px auto 0;
}

.vsl-wrap {
  position: relative;
}

.vsl-glow {
  position: absolute;
  inset: -20px;
  border-radius: 36px;
  background-color: rgba(0, 0, 0, 0.14);
  filter: blur(40px);
  pointer-events: none;
}

.vsl-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, #fafcfb 0%, #eff5f1 100%);
  box-shadow: var(--shadow-lift);
}

.vsl-frame iframe,
.vsl-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.vsl-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  gap: 12px;
  background-image:
    radial-gradient(circle at 50% 46%, rgba(26, 93, 58, 0.06) 0%, transparent 60%);
}

.vsl-play-btn {
  position: relative;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 9999px;
  background-color: var(--primary);
  color: var(--primary-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 26px -6px rgba(26, 93, 58, 0.44);
  transition: transform 170ms ease, background-color 170ms ease;
}

.vsl-play-btn:hover {
  background-color: var(--primary-hover);
  transform: scale(1.06);
}

.vsl-play-btn:active {
  transform: scale(0.98);
}

.vsl-play-btn:focus-visible {
  outline: 3px solid var(--primary-ring);
  outline-offset: 4px;
}

.vsl-play-ring {
  position: absolute;
  inset: -7px;
  border-radius: 9999px;
  border: 1.5px solid rgba(26, 93, 58, 0.22);
  pointer-events: none;
}

.vsl-play-icon {
  width: 24px;
  height: 24px;
  margin-left: 3px;
}

.vsl-caption {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted-foreground);
}

.cta-button {
  margin-top: 24px;
  width: 100%;
  cursor: pointer;
  border: 0;
  border-radius: 12px;
  background-color: var(--primary);
  padding: 16px 24px;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 800;
  color: var(--primary-foreground);
  transition: background-color 150ms ease, opacity 150ms ease;
}

.cta-button:hover {
  background-color: var(--primary-hover);
}

.cta-button:focus-visible {
  outline: 3px solid var(--primary-ring);
  outline-offset: 3px;
}

/* Responsive breakpoints matching Tailwind sm (640px) and lg (1024px) */
@media (min-width: 640px) {
  .site-header {
    padding-left: 24px;
    padding-right: 24px;
  }

  .brand-logo {
    height: 32px;
  }

  .main-container {
    padding: 40px 24px 64px;
  }

  .eyebrow {
    font-size: 16px;
  }

  .headline {
    font-size: 34px;
  }

  .subcopy {
    font-size: 16px;
  }
}

@media (min-width: 1024px) {
  .headline {
    font-size: 40px;
  }
}

/* Site Footer (exact match to apply.educo.io) */
.site-footer {
  margin-top: 80px;
  background-color: var(--foreground);
  color: var(--background);
}

.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 64px 24px;
}

.footer-logo {
  display: block;
  height: 28px;
  width: auto;
  filter: brightness(0) invert(1);
}

.footer-disclaimer {
  margin: 32px 0 0;
  max-width: 560px;
  font-size: 13px;
  line-height: 1.625;
  color: rgba(255, 255, 255, 0.5);
}

.footer-bottom {
  margin-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 24px;
}

.footer-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.footer-copyright {
  margin: 0;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-links a {
  color: inherit;
  text-decoration: none;
  transition: color 150ms ease;
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-sep {
  color: rgba(255, 255, 255, 0.25);
}

@media (min-width: 640px) {
  .footer-row {
    flex-direction: row;
    align-items: center;
  }
}

/* Two-Step Booking Modal (matching ApplyDialog.tsx sizing & polish) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 180ms ease;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-backdrop.is-visible {
  opacity: 1;
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  border-radius: 16px;
  background-color: #ffffff;
  color: var(--foreground);
  box-shadow: var(--shadow-lift);
  transform: translateY(8px) scale(0.985);
  transition:
    transform 200ms cubic-bezier(0.22, 1, 0.36, 1),
    max-width 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-backdrop.is-visible .modal-dialog {
  transform: translateY(0) scale(1);
}

/* Expands cleanly when shifting to Cal.com month view */
.modal-dialog[data-step="2"] {
  max-width: 920px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--muted);
}

.modal-step-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.step-pill {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background-color: var(--primary-soft);
  padding: 4px 10px;
  border-radius: 9999px;
  white-space: nowrap;
}

.step-progress {
  flex: 1;
  max-width: 120px;
  height: 4px;
  border-radius: 9999px;
  background-color: var(--muted);
  overflow: hidden;
}

.step-progress-bar {
  width: 50%;
  height: 100%;
  border-radius: 9999px;
  background-color: var(--primary);
  transition: width 240ms ease;
}

.modal-dialog[data-step="2"] .step-progress-bar {
  width: 100%;
}

.modal-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--muted-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.modal-close:hover {
  background-color: var(--muted);
  color: var(--foreground);
}

.modal-close:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

/* Modal Steps */
.modal-step {
  animation: stepFadeIn 200ms ease both;
}

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

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

.modal-step--form {
  padding: 20px;
}

@media (min-width: 640px) {
  .modal-header {
    padding: 16px 28px 12px;
  }

  .modal-step--form {
    padding: 24px 28px 28px;
  }
}

.modal-intro {
  margin-bottom: 16px;
}

.modal-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  color: var(--foreground);
}

@media (min-width: 640px) {
  .modal-title {
    font-size: 24px;
  }
}

.title-accent {
  color: var(--primary);
}

.modal-title--compact {
  font-size: 19px;
}

.modal-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
}

/* Lead Form */
.lead-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--foreground);
}

.required {
  color: var(--primary);
}

.optional {
  font-weight: 500;
  color: var(--muted-foreground);
}

/* 16px text stops iOS Safari from zooming in on focus */
.field-input {
  margin-top: 4px;
  display: block;
  height: 44px;
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: #ffffff;
  padding: 0 12px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  color: var(--foreground);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field-input::placeholder {
  color: rgba(107, 114, 128, 0.7);
}

.field-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-ring);
}

.field-input.is-invalid {
  border-color: var(--destructive);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.16);
}

.field-error {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--destructive);
}

.field-error:empty {
  display: none;
}

.form-submit {
  margin-top: 6px;
  height: 48px;
  width: 100%;
  cursor: pointer;
  border: 0;
  border-radius: 12px;
  background-color: var(--primary);
  padding: 0 24px;
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 800;
  color: var(--primary-foreground);
  transition: background-color 150ms ease;
}

.form-submit:hover {
  background-color: var(--primary-hover);
}

.form-submit:focus-visible {
  outline: 3px solid var(--primary-ring);
  outline-offset: 2px;
}

/* Step 2: Calendar Container */
.modal-step--calendar {
  padding: 16px 20px 20px;
}

@media (min-width: 640px) {
  .modal-step--calendar {
    padding: 20px 24px 24px;
  }
}

.calendar-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.calendar-summary {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.back-link {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 140ms ease, color 140ms ease, background-color 140ms ease;
}

.back-link:hover {
  background-color: var(--surface);
  color: var(--foreground);
}

.calendar-stage {
  position: relative;
  min-height: 540px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background-color: #ffffff;
  overflow: hidden;
}

.cal-embed-shell {
  width: 100%;
  min-height: 540px;
  height: 100%;
  overflow: auto;
}

.calendar-loader {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background-color: rgba(255, 255, 255, 0.96);
  color: var(--muted-foreground);
  font-size: 14px;
  font-weight: 600;
  transition: opacity 220ms ease;
}

.calendar-loader.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  border: 2.5px solid var(--primary-soft);
  border-top-color: var(--primary);
  animation: spin 750ms linear infinite;
}

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

@media (max-width: 639px) {
  .above-fold {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: clamp(16px, 3svh, 28px) 16px clamp(16px, 3svh, 32px);
  }

  .site-header {
    padding: 0;
    flex-shrink: 0;
  }

  .brand-logo {
    height: clamp(21px, 3.4svh, 27px);
  }

  .main-container {
    width: 100%;
    padding: clamp(18px, 3.6svh, 32px) 0 0;
  }

  .hero-section {
    width: 100%;
  }

  .eyebrow {
    padding: clamp(5px, 0.9svh, 7px) 14px;
    font-size: clamp(12px, 1.9svh, 14px);
  }

  .headline {
    margin-top: clamp(10px, 2svh, 18px);
    font-size: clamp(19px, min(5.8vw, 3.4svh), 26px);
    line-height: 1.17;
  }

  .subcopy {
    margin-top: clamp(10px, 1.8svh, 16px);
    font-size: clamp(12.5px, min(3.6vw, 2.05svh), 15px);
    line-height: 1.48;
  }

  .vsl-section {
    width: 100%;
    margin-top: clamp(16px, 3svh, 26px);
    max-width: min(100%, max(240px, calc((100svh - 330px) * 16 / 9)));
  }

  .vsl-glow {
    inset: -10px;
    border-radius: 24px;
    filter: blur(24px);
  }

  .vsl-play-btn {
    width: clamp(46px, 7.2svh, 58px);
    height: clamp(46px, 7.2svh, 58px);
  }

  .vsl-play-icon {
    width: clamp(18px, 2.8svh, 22px);
    height: clamp(18px, 2.8svh, 22px);
  }

  .cta-button {
    margin-top: clamp(14px, 2.5svh, 22px);
    padding: clamp(13px, 2svh, 16px) 20px;
    font-size: clamp(15px, 2.2svh, 17px);
  }

  .site-footer {
    margin-top: 0;
  }

  .calendar-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .calendar-stage,
  .cal-embed-shell {
    min-height: 460px;
  }
}
