*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --blue: #3b82f6;
  --blue-dark: #2563eb;
  --indigo: #6366f1;
  --text: #1f2937;
  --muted: #6b7280;
  --bg: #f9fafb;
  --card: #ffffff;
  --border: #e5e7eb;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.brand strong {
  display: block;
  font-size: 1.05rem;
}

.brand span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.nav-links {
  display: flex;
  gap: 20px;
  font-size: 0.9rem;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--blue);
}

.demo-mobile-link {
  display: none;
}

.hero {
  padding: 72px 0 56px;
  background: linear-gradient(180deg, #eff6ff 0%, var(--bg) 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  margin: 0 0 16px;
}

.hero .lead {
  font-size: 1.125rem;
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 540px;
}

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.store-btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.store-btn.primary {
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  color: #fff;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
}

.store-btn.secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}

.store-btn.disabled {
  opacity: 0.55;
  pointer-events: none;
  cursor: not-allowed;
}

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

.store-note {
  font-size: 0.85rem;
  color: var(--muted);
}

.phone-mock {
  background: var(--card);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  border: 1px solid var(--border);
  text-align: center;
}

.phone-mock img {
  width: 100%;
  max-width: 280px;
  display: block;
  margin: 0 auto;
  border-radius: 16px;
}

.features {
  padding: 56px 0;
}

.section-title {
  text-align: center;
  margin: 0 0 36px;
  font-size: 1.75rem;
}

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

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.feature-card .icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #eff6ff;
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 14px;
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.cta {
  padding: 56px 0 72px;
}

.cta-box {
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  color: #fff;
  border-radius: 20px;
  padding: 40px;
  text-align: center;
}

.cta-box h2 {
  margin: 0 0 10px;
  font-size: 1.75rem;
}

.cta-box p {
  margin: 0 0 24px;
  opacity: 0.92;
}

.cta-box .store-btn.secondary {
  background: #fff;
  border: none;
}

.free-note {
  margin-top: 16px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.access-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: 480px;
  margin: 0 auto 12px;
}

.access-email {
  flex: 1 1 220px;
  min-width: 0;
  border: none;
}

.access-submit {
  flex: 0 0 auto;
  background: #fff;
  color: var(--blue);
  font-weight: 700;
  padding: 12px 24px;
}

.access-status {
  min-height: 1.25rem;
  color: #fff;
}

.access-status.success {
  color: #bbf7d0;
}

.access-status.error {
  color: #fecaca;
}

.access-instructions[hidden] {
  display: none !important;
}

.access-instructions.is-visible,
.access-instructions:not([hidden]) {
  display: block;
}

.access-instructions {
  margin: 20px auto 0;
  max-width: 640px;
  text-align: left;
  background: #fff;
  color: #1e3a5f;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}

.access-instructions-title {
  margin: 0 0 12px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1d4ed8;
}

.access-instructions-wait {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  font-size: 0.95rem;
  line-height: 1.5;
}

.access-instructions-body {
  font-size: 0.92rem;
  line-height: 1.65;
}

.access-instructions-body p {
  margin: 0 0 12px;
}

.access-instructions-body ol,
.access-instructions-body ul {
  margin: 0 0 14px;
  padding-left: 20px;
}

.access-instructions-body li {
  margin-bottom: 8px;
}

.access-instructions-important {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.access-instructions-important p {
  margin: 0 0 8px;
}

.access-instructions-important ul {
  margin: 0;
}

.access-instructions-body a {
  color: var(--blue-dark);
  text-decoration: underline;
  word-break: break-word;
}

.access-instructions-body a:hover {
  opacity: 0.9;
}

.cta-footnote {
  margin: 16px 0 0;
  font-size: 0.85rem;
  opacity: 0.85;
}

.site-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer .links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
}

/* Legal pages */
.legal-page {
  padding: 40px 0 64px;
}

.legal-page h1 {
  margin: 0 0 8px;
}

.legal-page .updated {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 28px;
}

.legal-page section {
  margin-bottom: 24px;
}

.legal-page h2 {
  font-size: 1.05rem;
  margin: 0 0 8px;
}

.legal-page p {
  margin: 0;
  color: #4b5563;
}

.legal-page .disclaimer-box {
  padding: 16px 18px;
  border-radius: 12px;
  border: 1.2px solid #f59e0b;
  background: #fff7ed;
  margin-bottom: 28px;
}

.legal-page .disclaimer-box h2 {
  color: #92400e;
  margin-bottom: 8px;
}

.legal-page .disclaimer-box p {
  color: #78350f;
}

.gov-disclaimer,
.gov-disclaimer-foot {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #f59e0b;
  background: #fff7ed;
  color: #78350f;
  font-size: 0.875rem;
  line-height: 1.5;
}

.gov-disclaimer a,
.gov-disclaimer-foot a {
  color: #1d4ed8;
  font-weight: 600;
}

.gov-disclaimer-foot {
  margin-bottom: 12px;
  text-align: center;
}

.badge-soon {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.7rem;
  font-weight: 700;
  vertical-align: middle;
}

.subjects {
  padding: 48px 0;
  background: linear-gradient(180deg, var(--bg) 0%, #eff6ff 50%, var(--bg) 100%);
}

.section-subtitle {
  text-align: center;
  color: var(--muted);
  margin: -24px 0 28px;
  font-size: 1rem;
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  max-width: 900px;
  margin: 0 auto;
}

.subject-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.08);
  transition: transform 0.15s, box-shadow 0.15s;
}

.subject-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.12);
}

.subject-emoji {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.subject-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1d4ed8;
  line-height: 1.3;
}

.cta-version {
  color: rgba(255, 255, 255, 0.88) !important;
  margin-top: 16px;
}

.install-steps {
  padding: 0 0 56px;
}

.install-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.install-card ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.install-card li {
  margin-bottom: 8px;
}

.install-card li:last-child {
  margin-bottom: 0;
}

.version-tag {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.form-page {
  max-width: 640px;
}

.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 28px;
}

.form-intro {
  margin: 0 0 20px;
  color: #4b5563;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 6px;
}

.form-input {
  width: 100%;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.form-input:focus {
  outline: 2px solid rgba(99, 102, 241, 0.35);
  border-color: var(--indigo);
}

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

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 18px;
  font-size: 0.92rem;
  color: #4b5563;
  cursor: pointer;
}

.form-check input {
  margin-top: 3px;
}

.form-submit {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  cursor: pointer;
}

.form-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.form-status {
  margin: 14px 0 0;
  font-size: 0.92rem;
  min-height: 1.2em;
}

.form-status.success {
  color: #059669;
}

.form-status.error {
  color: #dc2626;
}

.form-note h2 {
  font-size: 1.05rem;
  margin: 0 0 10px;
}

.form-note ol {
  margin: 0 0 16px;
  padding-left: 20px;
  color: #4b5563;
}

.form-note li {
  margin-bottom: 6px;
}

.not-found-page {
  text-align: center;
  padding-top: 48px;
}

@media (max-width: 800px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero .lead {
    margin-left: auto;
    margin-right: auto;
  }

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

  .store-buttons {
    justify-content: center;
  }

  .nav-links {
    display: none;
  }

  .demo-mobile-link {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    padding: 8px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    white-space: nowrap;
  }

  .section-title {
    font-size: 1.5rem;
    margin-bottom: 28px;
  }

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

  .cta-box {
    padding: 28px 20px;
    border-radius: 16px;
  }

  .cta-box h2 {
    font-size: 1.45rem;
  }

  .access-instructions {
    padding: 16px;
  }

  .access-instructions-body {
    font-size: 0.88rem;
  }
}

@media (max-width: 480px) {
  .container {
    width: min(1100px, 94vw);
  }

  .site-header .container {
    padding: 10px 0;
    gap: 10px;
  }

  .brand img {
    width: 38px;
    height: 38px;
  }

  .brand strong {
    font-size: 0.95rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero .lead {
    font-size: 1rem;
  }

  .store-btn {
    width: 100%;
    justify-content: center;
  }

  .access-form {
    flex-direction: column;
    align-items: stretch;
  }

  .access-submit {
    width: 100%;
  }

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

  .site-footer .links {
    flex-wrap: wrap;
    flex-direction: column;
    gap: 10px;
  }
}
