/* ===== Design Tokens ===== */
:root {
  /* Primary */
  --primary-900: #20124a;
  --primary-800: #301B6B;
  --primary-700: #40258d;
  --primary-600: #5130af;
  --primary-500: #623cd0;
  --primary-400: #7A5CD9;
  --primary-300: #957FE2;
  --primary-200: #b3a5eb;
  --primary-100: #d4cdf4;
  --primary-50:  #f3f3ff;

  /* Secondary (teal) */
  --secondary-800: #0a6c81;
  --secondary-700: #1aa5a4;
  --secondary-600: #30b2b1;
  --secondary-400: #66CBCB;
  --secondary-300: #86d8d8;
  --secondary-200: #a8e5e4;
  --secondary-100: #CCF0F0;
  --secondary-50:  #f0fafa;

  /* Slate */
  --slate-900: #201f2d;
  --slate-800: #353442;
  --slate-700: #4A4958;
  --slate-600: #605f6e;
  --slate-400: #8d8c9d;
  --slate-300: #a6a5b5;
  --slate-200: #d5d5dc;
  --slate-100: #eeeef1;
  --slate-50:  #f8f8fb;

  /* Feedback */
  --red-600: #d73b3b;
  --red-50:  #fbeaea;
  --green-500: #43bf38;

  /* Base */
  --white: #ffffff;
  --black: #000000;

  /* Spacing */
  --sp-xs:  4px;
  --sp-sm:  8px;
  --sp-smd: 12px;
  --sp-md:  16px;
  --sp-lg:  24px;
  --sp-xl:  32px;
  --sp-2xl: 48px;
  --sp-3xl: 64px;
  --sp-4xl: 80px;

  /* Radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm:  0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl:  0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  --elevation-1: 0px 1px 3px rgba(116,115,135,0.2);
  --elevation-2: 0px 2px 2px rgba(116,115,135,0.12);

  /* Font */
  --font-sans: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: var(--slate-700);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }

/* ===== Utility ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sp-lg);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  padding: var(--sp-smd) var(--sp-lg);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.btn--primary {
  background: var(--primary-500);
  color: var(--white);
}
.btn--primary:hover {
  background: var(--primary-600);
}
.btn--primary:active {
  transform: scale(0.97);
}

.btn--pill { border-radius: var(--radius-full); }

.btn--lg {
  padding: var(--sp-md) var(--sp-xl);
  font-size: 18px;
}

.btn--full { width: 100%; padding: var(--sp-md); }

.btn--loading {
  pointer-events: none;
  opacity: 0.8;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ===== Nav ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--slate-100);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav__logo { height: 32px; width: auto; }

.nav__cta { font-size: 14px; padding: var(--sp-sm) var(--sp-md); }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(180deg, var(--primary-50) 0%, var(--white) 100%);
  padding: var(--sp-4xl) 0 var(--sp-3xl);
  text-align: center;
}

.hero__inner { max-width: 720px; }

.hero__title {
  font-size: 36px;
  line-height: 40px;
  font-weight: 800;
  color: var(--primary-900);
  margin-bottom: var(--sp-md);
}

.hero__subtitle {
  font-size: 18px;
  line-height: 28px;
  color: var(--slate-600);
  margin-bottom: var(--sp-xl);
}

.hero__cta { margin-bottom: var(--sp-smd); }

.hero__note {
  font-size: 14px;
  color: var(--slate-400);
}

/* ===== Features ===== */
.features {
  padding: var(--sp-3xl) 0;
}

.features__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-lg);
}

/* ===== Card ===== */
.card {
  background: var(--white);
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-lg);
  padding: var(--sp-xl);
  box-shadow: var(--elevation-1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card--feature { text-align: center; }
.card--feature:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--sp-md);
}

.card__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-900);
  margin-bottom: var(--sp-sm);
}

.card__text {
  font-size: 15px;
  line-height: 24px;
  color: var(--slate-600);
}

/* ===== Steps ===== */
.steps {
  padding: var(--sp-3xl) 0;
  background: var(--slate-50);
}

.steps__heading {
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  color: var(--primary-900);
  margin-bottom: var(--sp-2xl);
}

.steps__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-xl);
  text-align: center;
}

.step__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--secondary-600);
  color: var(--white);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: var(--sp-md);
}

.step__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-900);
  margin-bottom: var(--sp-sm);
}

.step__text {
  font-size: 15px;
  line-height: 24px;
  color: var(--slate-600);
  max-width: 280px;
  margin: 0 auto;
}

/* ===== Signup ===== */
.signup {
  padding: var(--sp-3xl) 0;
}

.card--form {
  max-width: 520px;
  margin: 0 auto;
  padding: var(--sp-2xl);
  box-shadow: var(--shadow-lg);
}

.card__heading {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary-900);
  margin-bottom: var(--sp-sm);
  text-align: center;
}

.card__subheading {
  font-size: 16px;
  color: var(--slate-600);
  margin-bottom: var(--sp-xl);
  text-align: center;
}

/* ===== Form ===== */
.form__field { margin-bottom: var(--sp-md); }

.form__label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: var(--sp-xs);
}

.input {
  display: block;
  width: 100%;
  padding: var(--sp-smd) var(--sp-md);
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--slate-900);
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}

.input::placeholder { color: var(--slate-400); }

.input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.input--invalid {
  border-color: var(--red-600);
}
.input--invalid:focus {
  box-shadow: 0 0 0 3px rgba(215,59,59,0.15);
}

.input--select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238d8c9d' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.input-error {
  display: block;
  font-size: 13px;
  color: var(--red-600);
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s, margin 0.2s;
}

.input-error--visible {
  max-height: 24px;
  margin-top: var(--sp-xs);
}

/* ===== General form error ===== */
.form-general-error {
  font-size: 14px;
  color: var(--red-600);
  background: var(--red-50);
  border: 1px solid var(--red-600);
  border-radius: var(--radius-md);
  padding: var(--sp-smd) var(--sp-md);
  margin-bottom: var(--sp-md);
  text-align: center;
}

/* ===== Success state ===== */
.form-success {
  text-align: center;
  padding: var(--sp-2xl) 0;
}

.form-success__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto var(--sp-lg);
}

.form-success__title {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-900);
  margin-bottom: var(--sp-sm);
}

.form-success__text {
  font-size: 16px;
  color: var(--slate-600);
}

/* ===== Footer ===== */
.footer {
  padding: var(--sp-2xl) 0;
  border-top: 1px solid var(--slate-100);
  text-align: center;
}

.footer__logo {
  height: 28px;
  margin: 0 auto var(--sp-sm);
}

.footer__copy {
  font-size: 14px;
  color: var(--slate-400);
}

/* ===== Animations ===== */
.fade-out {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

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

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (min-width: 600px) {
  .features__grid { grid-template-columns: repeat(3, 1fr); }
  .steps__grid    { grid-template-columns: repeat(3, 1fr); }

  .hero__title {
    font-size: 46px;
    line-height: 52px;
  }
}

@media (min-width: 1240px) {
  .hero__title {
    font-size: 58px;
    line-height: 66px;
  }

  .hero {
    padding: 120px 0 var(--sp-4xl);
  }
}
