/* WahaAI landing page. Palette matches the app. No external fonts or requests. */
:root {
  --bg: #10251f;
  --surface: #1b382e;
  --surface-light: #254438;
  --gold: #d6b779;
  --ivory: #f3ebdd;
  --muted: #91a49a;
  --border: #345044;
  --red: #f29a92; /* soft red for "missing" (AA on --surface) */
  --radius: 16px;
  --arabic: "Amiri", "Noto Naskh Arabic", "Scheherazade New", "Geeza Pro", "Traditional Arabic", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ivory);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5.5vw, 3.1rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); }
h3 { font-size: 1.1rem; color: var(--gold); }
p { margin: 0 0 1em; }
a { color: var(--gold); }
a:hover { color: var(--ivory); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.narrow { width: min(760px, 100% - 2rem); margin-inline: auto; }
.center { text-align: center; }
.muted { color: var(--muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; inset-inline-start: .5rem; top: -4rem; background: var(--gold); color: var(--bg);
  padding: .5rem 1rem; border-radius: 8px; z-index: 100; text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: .5rem; }
.noscript { background: var(--surface-light); padding: .75rem 1rem; margin: 0; text-align: center; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(16, 37, 31, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; justify-content: space-between; padding: .75rem 0; gap: .75rem; }
.header-actions { display: flex; align-items: center; gap: 1rem; }
.lang-switch { color: var(--ivory); text-decoration: none; font-weight: 600; padding: .5rem .25rem; min-height: 40px; display: inline-flex; align-items: center; border-bottom: 2px solid transparent; }
.lang-switch:hover { color: var(--gold); border-bottom-color: var(--gold); }
.brand { color: var(--gold); font-weight: 700; font-size: 1.25rem; text-decoration: none; letter-spacing: .01em; }

/* Buttons */
.btn {
  display: inline-block; border: 0; cursor: pointer; font: inherit; font-weight: 600;
  background: var(--gold); color: var(--bg); padding: .75rem 1.25rem; border-radius: 999px;
  text-decoration: none; min-height: 44px;
}
.btn:hover { background: var(--ivory); color: var(--bg); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-small { padding: .5rem 1rem; min-height: 40px; font-size: .95rem; white-space: nowrap; }
@media (max-width: 480px) {
  .header-actions { gap: .5rem; }
  .btn-small { padding: .4rem .8rem; font-size: .85rem; }
  .lang-switch { font-size: .9rem; }
}
.btn-outline { background: transparent; color: var(--ivory); border: 2px solid var(--gold); }
.btn-outline:hover { background: var(--gold); color: var(--bg); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--gold); text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--ivory); }

/* Anchor jumps (e.g. "Join the waitlist") leave room for the sticky header plus some breathing space. */
[id] { scroll-margin-top: 5rem; }
#waitlist { scroll-margin-top: 7rem; }

/* Hero */
.hero { padding: clamp(2rem, 6vw, 4.5rem) 0; }
.hero-grid { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.1fr .9fr; gap: 3.5rem; } }
.tagline { color: var(--gold); font-size: 1.2rem; font-weight: 600; }
.lede { color: var(--ivory); opacity: .92; max-width: 34em; }
.availability { display: inline-block; margin: 0 0 .75rem; padding: .6rem 1.4rem; font-size: clamp(1.1rem, 3vw, 1.35rem); font-weight: 700; line-height: 1.4; color: var(--gold); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; }

/* Sections */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section.alt { background: var(--surface); }
.cards, .ticks, .steps { list-style: none; margin: 1.5rem 0; padding: 0; }
.cards { display: grid; gap: 1rem; }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.cards li, .steps li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.alt .steps li { background: var(--bg); }
.cards p, .steps p { margin: 0; color: var(--ivory); opacity: .9; }
.steps { counter-reset: s; display: grid; gap: 1rem; }
.steps li { counter-increment: s; position: relative; padding-inline-start: 4rem; }
.steps li::before {
  content: counter(s); position: absolute; inset-inline-start: 1.25rem; top: 1.1rem; width: 1.9rem; height: 1.9rem;
  border-radius: 50%; background: var(--gold); color: var(--bg); font-weight: 700; display: grid; place-items: center;
}
.ticks li { padding: .4rem 0; padding-inline-start: 2rem; position: relative; }
.ticks li::before { content: "✓"; position: absolute; inset-inline-start: 0; color: var(--gold); font-weight: 700; }

/* Arabic + hadith */
.ar { font-family: var(--arabic); font-size: 1.7rem; line-height: 2.1; text-align: right; margin: 0 0 .5em; }
.ar-big { font-size: clamp(1.8rem, 5vw, 2.5rem); text-align: center; color: var(--gold); }
.inline-ar { font-family: var(--arabic); font-size: 1.2em; color: var(--gold); }
.quote { margin: 1.5rem 0; padding: 1.5rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); }
.quote blockquote { margin: 0; }
.quote .en { text-align: center; font-size: 1.1rem; }
.quote figcaption { color: var(--muted); text-align: center; font-size: .9rem; }

/* Waitlist form */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-top: 1.5rem; }
.section .form-card { margin-top: 0; }
.form-title { font-size: 1.4rem; margin-bottom: .25rem; color: var(--gold); }
.form-sub { color: var(--ivory); opacity: .9; }
.waitlist-form label:not(.check) { display: block; font-size: .9rem; color: var(--muted); margin-bottom: .25rem; }
.form-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.form-row input[type="email"] {
  flex: 1 1 14rem; min-height: 44px; padding: .65rem 1rem; font: inherit; color: var(--ivory);
  background: var(--bg); border: 2px solid var(--border); border-radius: 999px;
}
.form-row input[type="email"]::placeholder { color: var(--muted); }
.form-row input[aria-invalid="true"] { border-color: var(--red); }
.check { display: flex; gap: .6rem; align-items: flex-start; margin-top: .9rem; font-size: .92rem; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: .1rem 0 0; flex: none; accent-color: var(--gold); }
.check input[aria-invalid="true"] { outline: 2px solid var(--red); }
/* Honeypot: hidden without moving it off-screen (that would add scrollable width in RTL). */
.hp-field { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; opacity: 0; pointer-events: none; }
.form-status { min-height: 1.5em; margin: .75rem 0 0; font-weight: 600; }
.form-status.is-error { color: var(--red); }
.form-status.is-success { color: var(--gold); }
.form-status.is-info { color: var(--muted); }

/* Demo */
.demo-col { display: flex; justify-content: center; }
.demo { width: min(100%, 360px); }
.phone { background: var(--surface); border: 2px solid var(--border); border-radius: 36px; padding: 1.5rem 1.25rem; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.demo-stage { display: grid; min-height: 380px; }
.step { grid-area: 1 / 1; visibility: hidden; opacity: 0; transition: opacity .35s; display: flex; flex-direction: column; justify-content: center; }
/* No JavaScript: show only the final feedback step. */
.step[data-step="4"] { visibility: visible; opacity: 1; }
.demo-js .step { visibility: hidden; opacity: 0; }
.demo-js .step.is-active { visibility: visible; opacity: 1; }
.step-label { color: var(--gold); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.step .en { font-size: .95rem; color: var(--ivory); opacity: .9; }
.hint { color: var(--muted); font-size: .9rem; text-align: center; }
.step .icon { color: var(--gold); }
.mic { width: 84px; height: 84px; margin: 1.5rem auto 1rem; border-radius: 50%; background: var(--surface-light); display: grid; place-items: center; }
.mic-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--red); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(.8); opacity: .7; } 50% { transform: scale(1.25); opacity: 1; } }
.timer { text-align: center; font-variant-numeric: tabular-nums; font-size: 1.4rem; }
.spinner { width: 52px; height: 52px; margin: 2rem auto 1rem; border-radius: 50%; border: 5px solid var(--surface-light); border-top-color: var(--gold); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.score { text-align: center; margin-bottom: .25rem; }
.score-num { font-size: 2.6rem; font-weight: 800; color: var(--gold); }
.score-cap { color: var(--muted); }
.ar-result { font-size: 1.5rem; line-height: 2.2; }
/* Result states use colour AND a second cue (line / dotted underline) so colour is never the only signal. */
.w { padding: 0 .15em; border-radius: 4px; }
.w-ok { color: var(--ivory); }
.w-missing { color: var(--red); text-decoration: line-through; text-decoration-thickness: 2px; }
.w-unsure { color: var(--gold); text-decoration: underline dotted; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.legend { list-style: none; margin: .5rem 0 0; padding: 0; font-size: .85rem; }
.legend li { margin-bottom: .6rem; }
.legend .w { font-family: var(--arabic); font-size: 1.2rem; }

.demo-controls { display: flex; align-items: center; justify-content: space-between; margin-top: 1rem; gap: .5rem; }
.ctrl { background: transparent; color: var(--ivory); border: 2px solid var(--border); border-radius: 999px; padding: .4rem 1rem; min-height: 44px; min-width: 44px; font: inherit; cursor: pointer; }
.ctrl:hover { border-color: var(--gold); }
.dots { display: flex; gap: .4rem; }
.dot { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--border); background: transparent; color: var(--ivory); font: inherit; font-weight: 600; cursor: pointer; }
.dot:hover { border-color: var(--gold); }
.dot.is-active { background: var(--gold); color: var(--bg); border-color: var(--gold); }
.demo-note { color: var(--muted); font-size: .85rem; text-align: center; margin-top: .75rem; }

/* Reduced motion: no animation; show all four steps one after another. */
.demo.is-static .demo-controls { display: none; }
.demo.is-static .demo-stage { display: flex; flex-direction: column; gap: 1.5rem; min-height: 0; }
.demo.is-static .step { visibility: visible; opacity: 1; border-bottom: 1px solid var(--border); padding-bottom: 1.25rem; }
.demo.is-static .step:last-child { border-bottom: 0; padding-bottom: 0; }
.demo.is-static .mic-dot, .demo.is-static .spinner { animation: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.video-slot { margin-top: 1.5rem; }
.video-slot video { width: 100%; border-radius: var(--radius); }

/* Footer + consent */
.site-footer { border-top: 1px solid var(--border); padding: 1.5rem 0 5rem; color: var(--muted); font-size: .92rem; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; }
.footer-row p { margin: 0; }
.consent {
  position: fixed; left: .75rem; right: .75rem; bottom: .75rem; z-index: 50; max-width: 720px; margin-inline: auto;
  background: var(--surface-light); border: 1px solid var(--gold); border-radius: var(--radius); padding: 1rem 1.25rem;
  display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}
.consent[hidden] { display: none; }
.consent p { margin: 0; font-size: .92rem; flex: 1 1 18rem; }
.consent-actions { display: flex; gap: .5rem; }

/* Privacy page */
.doc { padding: 2.5rem 0 4rem; }
.doc h1 { font-size: 2rem; }
.doc h2 { font-size: 1.25rem; margin-top: 2rem; color: var(--gold); }
.doc ul { padding-inline-start: 1.25rem; }
.doc li { margin-bottom: .4rem; }
.doc .draft { background: var(--surface); border-inline-start: 4px solid var(--gold); padding: .75rem 1rem; border-start-end-radius: 8px; border-end-end-radius: 8px; }

/* Arabic (RTL) pages. Layout mirrors automatically from dir="rtl" plus the logical properties above. */
[dir="rtl"] body { font-family: system-ui, -apple-system, "Segoe UI", Tahoma, "Noto Sans Arabic", "Geeza Pro", Arial, sans-serif; line-height: 1.85; }
/* Letter-spacing breaks the joining of Arabic letters, so switch it off. */
[dir="rtl"] *, [dir="rtl"] *::before, [dir="rtl"] *::after { letter-spacing: 0 !important; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { line-height: 1.5; }
[dir="rtl"] .step-label { text-transform: none; font-size: .95rem; }
/* Email addresses are always left-to-right. */
[dir="rtl"] input[type="email"] { direction: ltr; text-align: left; }
[dir="rtl"] input[type="email"]::placeholder { text-align: left; }
[dir="rtl"] .ar { text-align: right; }
[dir="rtl"] .ar-big { text-align: center; }
[dir="rtl"] .quote .en, [dir="rtl"] .quote figcaption { text-align: center; }
