/* Livin landing site — the design system's tokens (flutter-app/lib/shared/livin_tokens.dart)
   transcribed to CSS custom properties. Keep the semantic names so a value can be checked
   against LivinColors when the design moves. */
:root {
  --ocean-500: #00AEAC;          /* LivinColors.ocean500 — the launch teal */
  --ocean-400: #40C2C1;
  --ocean-700: #003D3C;
  --ocean-800: #002524;
  --action-primary: #44A09E;     /* surfaceActionPrimaryDefault */
  --action-secondary: #C1DFDF;   /* surfaceActionSecondaryDefault */
  --text-primary: #0B0B0B;
  --text-secondary: #353131;     /* textSecondary = shell800 */
  --text-tertiary: #6F7271;
  --text-invert: #FFFFFF;
  --text-action: #33A98B;        /* textActionSecondary */
  --surface: #FFFFFF;
  --surface-secondary: #F9F9F9;
  --surface-grey: #F1F1F1;       /* accentSurfaceGrey */
  --surface-shell: #FFFAF9;      /* accentSurfaceLightShell */
  --surface-turquoise: #E6F2F2;  /* accentSurfaceLightTurquoise */
  --surface-jade: #EEF8F3;
  --surface-sand: #FDE8DC;
  --surface-sunset: #FAEFE9;
  --border: #E2E3E3;
  --hero-base: #FBF8F8;
  --coral: #FF5C35;
  --radius-s: 12px;
  --radius-m: 20px;
  --radius-full: 200px;
  --font-latin: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-arabic: 'Noto Sans Arabic', 'Plus Jakarta Sans', system-ui, sans-serif;
  --max: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-latin);
  color: var(--text-primary);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
html[dir="rtl"] body { font-family: var(--font-arabic); }
a { color: var(--text-action); }
[hidden] { display: none !important; }
.muted { color: var(--text-tertiary); }

/* ── Top bar (over the hero) ─────────────────────────────────────────────── */
.topbar {
  position: absolute; inset: 0 0 auto 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(16px, 4vw, 40px);
}
.brand { display: inline-flex; }
.wordmark { height: 30px; width: auto; filter: brightness(0) invert(1); }
.lang-switch {
  font: 600 14px/1 var(--font-latin);
  color: var(--text-invert);
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: var(--radius-full);
  padding: 10px 16px; cursor: pointer;
  backdrop-filter: blur(8px);
}
html[dir="rtl"] .lang-switch { font-family: var(--font-arabic); }

/* ── Hero — the app's Welcome screen: image, dark gradient, white copy ────── */
.hero {
  position: relative; min-height: 88vh;
  display: flex; align-items: flex-end;
  color: var(--text-invert);
  background: var(--ocean-500);
  overflow: hidden;
}
.hero-media {
  position: absolute; inset: 0;
  background: url('/assets/hero.jpg') center/cover no-repeat;
}
.hero-media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.10) 0%, rgba(0,0,0,.45) 45%, rgba(0,0,0,.90) 100%);
}
.hero-content {
  position: relative; width: 100%; max-width: var(--max);
  margin: 0 auto; padding: 120px clamp(16px, 4vw, 40px) 64px;
  text-align: center;
}
.eyebrow { margin: 0 0 12px; font-size: 14px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
html[dir="rtl"] .eyebrow { letter-spacing: 0; }
.hero h1 { margin: 0 0 12px; font-size: clamp(32px, 6vw, 56px); line-height: 1.1; font-weight: 800; letter-spacing: .5px; }
html[dir="rtl"] .hero h1 { letter-spacing: 0; }
.lede { margin: 0 auto 32px; max-width: 560px; font-size: 16px; }

/* ── Store block (shared by the hero and the open page) ──────────────────── */
.stores { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.stores-note { margin: 0; font-size: 14px; opacity: .9; }
.badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.badge {
  display: inline-flex; align-items: center; gap: 12px;
  min-width: 190px; padding: 10px 18px;
  border-radius: var(--radius-s);
  background: var(--text-primary); color: var(--text-invert);
  text-decoration: none; text-align: start;
  border: 1px solid rgba(255,255,255,.25);
  transition: transform .15s ease;
  font-family: var(--font-latin); direction: ltr;
}
.badge:hover { transform: translateY(-1px); }
.badge svg { width: 26px; height: 26px; flex: none; }
.badge small { display: block; font-size: 11px; line-height: 1.1; opacity: .85; }
.badge strong { display: block; font-size: 18px; line-height: 1.15; font-weight: 700; }
.badge.soon { opacity: .55; cursor: default; position: relative; }
.badge.soon::after {
  content: attr(data-soon);
  position: absolute; top: -10px; inset-inline-end: 10px;
  font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--coral); color: var(--text-invert);
  font-family: inherit;
}
html[dir="rtl"] .badge.soon::after { font-family: var(--font-arabic); }
.stores-compact .badge { background: var(--text-primary); border-color: transparent; }

/* ── Features ─────────────────────────────────────────────────────────────── */
.features { max-width: var(--max); margin: 0 auto; padding: 72px clamp(16px, 4vw, 40px) 24px; }
.features h2 { margin: 0 0 32px; text-align: center; font-size: clamp(24px, 3.5vw, 32px); font-weight: 700; }
.feature-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.feature {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 20px; border-radius: var(--radius-m);
  background: var(--surface-grey);
}
.feature .glyph {
  flex: none; width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--surface); color: var(--action-primary);
}
.feature .glyph svg { width: 24px; height: 24px; }
.feature h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.feature p { margin: 0; font-size: 14px; color: var(--text-secondary); }

/* ── Register card ────────────────────────────────────────────────────────── */
.register { max-width: var(--max); margin: 0 auto; padding: 24px clamp(16px, 4vw, 40px) 72px; }
.register-card {
  display: flex; gap: 20px; align-items: center;
  padding: 24px; border-radius: var(--radius-m);
  background: var(--surface-turquoise);
}
.register-card h3 { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
.register-card p { margin: 0; color: var(--text-secondary); }
.app-icon { border-radius: 16px; flex: none; }

/* ── Open-in-Livin card page ──────────────────────────────────────────────── */
.card-page {
  min-height: 100vh; display: grid; place-items: center;
  padding: 96px clamp(16px, 4vw, 40px) 48px;
  background: linear-gradient(180deg, var(--ocean-500) 0 45%, var(--surface-secondary) 45% 100%);
}
.card {
  width: 100%; max-width: 440px; padding: 32px 28px;
  border-radius: var(--radius-m); background: var(--surface);
  box-shadow: 0 20px 60px rgba(0,37,36,.18);
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.card h1 { margin: 8px 0 0; font-size: 24px; font-weight: 700; }
.card .muted { margin: 0 0 8px; font-size: 14px; }
.btn {
  display: inline-block; padding: 14px 28px; border-radius: var(--radius-full);
  font-weight: 700; font-size: 16px; text-decoration: none; text-align: center;
}
.btn-primary { background: var(--action-primary); color: var(--text-invert); }
.btn-secondary { background: var(--surface-turquoise); color: var(--ocean-700); }
.stores-compact { margin-top: 12px; }
.stores-compact .stores-note { color: var(--text-tertiary); }

/* ── Policy document page ─────────────────────────────────────────────────── */
.doc-page { max-width: 760px; margin: 0 auto; padding: 96px clamp(16px, 4vw, 40px) 64px; }
.doc-page .back { display: inline-block; margin-bottom: 20px; font-weight: 600; text-decoration: none; }
.doc-page h1 { margin: 0 0 4px; font-size: clamp(26px, 4vw, 36px); font-weight: 700; }
.doc-page .muted { margin: 0 0 24px; font-size: 14px; }
.doc-body p { margin: 0 0 16px; color: var(--text-secondary); white-space: pre-wrap; }
.doc-page .btn { margin-top: 12px; }
#viewPolicy ~ .footer, #viewOpen ~ .footer { border-top: 1px solid var(--border); }
/* The top bar sits on white on these pages, so the wordmark and switch go dark. */
body.on-light .wordmark { filter: none; }
body.on-light .lang-switch { color: var(--text-primary); background: var(--surface-grey); border-color: var(--border); }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
  max-width: var(--max); margin: 0 auto; padding: 24px clamp(16px, 4vw, 40px) 40px;
  font-size: 14px; color: var(--text-tertiary);
}
.footer p { margin: 0; }
.footer nav { display: flex; gap: 10px; }
.footer a { color: var(--text-secondary); text-decoration: none; font-weight: 600; }
.footer a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .hero { min-height: 92vh; }
  .badge { min-width: 0; width: 100%; justify-content: center; }
  .register-card { flex-direction: column; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .badge { transition: none; } }
