/* ═══════════════════════════════════════════════════════════
   Train Together — Shared Website Styles
   Palette extracted from Flutter app theme (lib/main.dart)
   ═══════════════════════════════════════════════════════════ */

:root {
  --color-primary: #3F51B5;
  --color-primary-light: #E8EAF6;
  --color-primary-dark: #303F9F;
  --color-app-bar: #607D8B;
  --color-app-bar-dark: #455A64;
  --color-success: #4CAF50;
  --color-error: #F44336;
  --color-warning: #FF9800;
  --color-bg: #F9F9F9;
  --color-surface: #FFFFFF;
  --color-text: #212121;
  --color-text-secondary: #757575;
  --color-border: #E0E0E0;
  --color-border-light: #F0F0F0;
  --max-width: 1080px;
  --radius: 8px;
  --radius-lg: 12px;
}

/* ─── Reset ───────────────────────────────────────────────── */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* ─── Layout ──────────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 64px 0;
}

.section--alt {
  background: var(--color-surface);
}

/* ─── Navigation ──────────────────────────────────────────── */

.nav {
  background: var(--color-app-bar);
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav__brand {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.nav__brand:hover {
  text-decoration: none;
}

.nav__links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav__links a {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}

.nav__links a:hover {
  color: #fff;
  text-decoration: none;
}

/* Mobile nav toggle */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

@media (max-width: 768px) {
  .nav__toggle {
    display: block;
  }
  .nav__links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--color-app-bar-dark);
    flex-direction: column;
    padding: 12px 20px;
    gap: 0;
  }
  .nav__links.active {
    display: flex;
  }
  .nav__links a {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .nav__links li:last-child a {
    border-bottom: none;
  }
}

/* ─── Hero ────────────────────────────────────────────────── */

.hero {
  background: var(--color-app-bar);
  color: #fff;
  text-align: center;
  padding: 80px 20px 72px;
}

.hero__title {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.hero__subtitle {
  font-size: 18px;
  color: rgba(255,255,255,0.8);
  max-width: 520px;
  margin: 0 auto 36px;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .hero {
    padding: 56px 20px 48px;
  }
  .hero__title {
    font-size: 28px;
  }
  .hero__subtitle {
    font-size: 16px;
  }
}

/* ─── Store Buttons ───────────────────────────────────────── */

.store-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
}

.store-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  text-decoration: none;
}

.store-btn--apple {
  background: #000;
  color: #fff;
}

.store-btn--google {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.store-btn svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* ─── Features Grid ───────────────────────────────────────── */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  padding: 0 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: box-shadow 0.2s;
}

.feature-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.feature-card__icon {
  width: 44px;
  height: 44px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}

.feature-card__title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card__desc {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* ─── CTA Section ─────────────────────────────────────────── */

.cta {
  text-align: center;
  padding: 56px 20px;
}

.cta__title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
}

.cta__desc {
  color: var(--color-text-secondary);
  margin-bottom: 28px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.cta__buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── Buttons ─────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
  line-height: 1.4;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--color-primary-dark);
}

.btn--secondary {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn--secondary:hover {
  background: var(--color-primary-light);
}

.btn--success {
  background: var(--color-success);
  color: #fff;
}

.btn--full {
  width: 100%;
}

/* ─── Forms ───────────────────────────────────────────────── */

.form-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 20px 64px;
}

.form-page__title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.form-page__desc {
  color: var(--color-text-secondary);
  margin-bottom: 32px;
  font-size: 15px;
}

.form-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
}

@media (max-width: 768px) {
  .form-card {
    padding: 24px 20px;
  }
}

.form-group {
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text);
}

.form-label--optional::after {
  content: ' (optional)';
  font-weight: 400;
  color: var(--color-text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  color: var(--color-text);
  background: #fff;
  transition: border-color 0.15s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-hint {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

.form-error {
  font-size: 12px;
  color: var(--color-error);
  margin-top: 4px;
  display: none;
}

/* ─── Alert / Status Messages ─────────────────────────────── */

.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 20px;
  display: none;
}

.alert--success {
  background: #E8F5E9;
  color: #2E7D32;
  border: 1px solid #C8E6C9;
}

.alert--error {
  background: #FFEBEE;
  color: #C62828;
  border: 1px solid #FFCDD2;
}

.alert.visible {
  display: block;
}

/* ─── Footer ──────────────────────────────────────────────── */

.footer {
  background: var(--color-app-bar-dark);
  color: rgba(255,255,255,0.7);
  padding: 40px 20px;
  text-align: center;
}

.footer__links {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.footer__links a {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
}

.footer__links a:hover {
  color: #fff;
}

.footer__contact {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 4px;
}
.footer__contact a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
}
.footer__contact a:hover {
  text-decoration: underline;
}
.footer__copy {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

/* ─── Legal Pages ─────────────────────────────────────────── */

.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 64px;
}

.legal-page h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.legal-page .effective-date {
  color: var(--color-text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
}

.legal-page h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 32px 0 12px;
}

.legal-page h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 24px 0 8px;
}

.legal-page p {
  margin-bottom: 12px;
  font-size: 15px;
  line-height: 1.7;
}

.legal-page ul, .legal-page ol {
  margin: 8px 0 16px 24px;
}

.legal-page li {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 4px;
}

.legal-page a {
  color: var(--color-primary);
}

/* ─── Spinner ─────────────────────────────────────────────── */

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Utility ─────────────────────────────────────────────── */

.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none; }
