/* FlashReplai website. Colors and type follow the FlashReplai design system (see BRAND_CONTEXT.md). */
@font-face {
  font-family: "Readex Pro";
  src: url("/assets/fonts/ReadexPro-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --surface: #F7F6FB;
  --surface-raised: #FFFFFF;
  --tint: #E6DFFF;
  --line: #DCD8EA;
  --control-border: #8A84A3;
  --ink: #160F2E;
  --muted: #5C5677;
  --brand: #5B2BE0;
  --brand-deep: #2E1678;
  --on-brand: #FFFFFF;
  --on-deep-muted: #D9D2FF;
  --spark: #FFC23D;
  --danger: #C02B3F;
  --success: #137A4B;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --font: "Readex Pro", "Noto Sans Arabic", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 28px;
  color: var(--ink);
  background: var(--surface);
}
a { color: var(--brand); }
a:hover { color: var(--brand-deep); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}
h1, h2, h3, p { margin: 0; }

/* Mobile first: base styles are for phones; wider screens add to them at 640px (md) and 960px (lg). */
.container { max-width: 1160px; margin: 0 auto; padding-inline: 16px; }
@media (min-width: 640px) { .container { padding-inline: 24px; } }
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 22px; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.nowrap { white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 16px; top: -60px; background: var(--brand); color: var(--on-brand); padding: 10px 16px; border-radius: var(--radius-md); z-index: 10; }
.skip-link:focus { top: 16px; color: var(--on-brand); }

/* Wordmark */
.wordmark { font-weight: 700; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; direction: ltr; unicode-bidi: isolate; }
.wordmark .ai { color: var(--brand); }
.wordmark:hover { color: var(--ink); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 14px 24px; border-radius: var(--radius-md); font: inherit; font-weight: 600; text-decoration: none; text-align: center; border: 1.5px solid transparent; cursor: pointer; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-deep); color: var(--on-brand); }
.btn-secondary { background: var(--surface-raised); color: var(--ink); border-color: var(--line); font-weight: 500; }
.btn-secondary:hover { color: var(--ink); border-color: var(--control-border); }
.btn-outline { background: var(--surface-raised); color: var(--brand); border-color: var(--brand); }
.btn-light { background: #FFFFFF; color: var(--brand-deep); }
.btn-light:hover { color: var(--brand); }
.btn-small { min-height: 44px; padding: 10px 16px; font-size: 15px; font-weight: 500; }
@media (min-width: 640px) { .btn { padding-inline: 28px; } .btn-small { padding-inline: 20px; } }

/* Header: one row on every screen. Phones show the wordmark, language switch and demo button;
   the section links join them from 960px. */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--surface-raised); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-block: 10px; min-height: 64px; }
.site-header .wordmark { font-size: 20px; line-height: 28px; flex: none; }
.site-nav { display: flex; align-items: center; gap: 4px 14px; font-size: 15px; }
/* The header button is dropped on the narrowest phones, where it can't fit beside the wordmark;
   the hero's own "Book a demo" button is right below. */
.site-nav .btn { display: none; white-space: nowrap; min-height: 40px; padding: 8px 12px; font-size: 14px; }
@media (min-width: 360px) { .site-nav .btn { display: inline-flex; } }
.site-nav a:not(.btn) { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.site-nav a:not(.btn):not(.lang) { display: none; }
.site-nav a:not(.btn):hover { color: var(--brand); }
.site-nav .lang { color: var(--muted); }
@media (min-width: 640px) {
  .site-header .wordmark { font-size: 26px; line-height: 32px; }
  .site-nav .btn { min-height: 44px; padding: 10px 20px; font-size: 15px; }
}
@media (min-width: 960px) {
  .site-header .container { padding-block: 14px; }
  .site-nav { gap: 8px 24px; }
  .site-nav a:not(.btn):not(.lang) { display: inline-flex; }
}

/* Hero */
.hero { display: flex; flex-direction: column; gap: 32px; padding-block: 32px 48px; }
.hero-text { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.hero h1 { font-size: 34px; line-height: 42px; font-weight: 700; letter-spacing: -0.02em; }
html[lang="ar"] .hero h1 { line-height: 52px; letter-spacing: 0; }
.hero .lead { font-size: 17px; line-height: 28px; color: var(--muted); max-width: 560px; }
html[lang="ar"] .hero .lead { line-height: 30px; }
.actions { display: flex; flex-direction: column; gap: 12px; }
.actions .btn { width: 100%; }
@media (min-width: 640px) {
  .hero { padding-block: 56px 64px; gap: 48px; }
  .hero h1 { font-size: 46px; line-height: 54px; }
  html[lang="ar"] .hero h1 { line-height: 64px; }
  .hero .lead { font-size: 19px; line-height: 30px; }
  html[lang="ar"] .hero .lead { line-height: 32px; }
  .actions { flex-direction: row; flex-wrap: wrap; }
  .actions .btn { width: auto; }
}
@media (min-width: 960px) {
  .hero { flex-direction: row; align-items: center; gap: 56px; padding-block: 72px 64px; }
  .hero-text { flex: 1 1 0; gap: 24px; }
  .hero h1 { font-size: 56px; line-height: 62px; }
  html[lang="ar"] .hero h1 { line-height: 72px; }
}

/* Chat mock */
.chat { width: 100%; min-width: 0; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.chat-window { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.chat-head { background: var(--brand-deep); color: var(--on-brand); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chat-head > div { min-width: 0; }
.chat-head strong { display: block; font-weight: 600; font-size: 15px; line-height: 22px; }
.chat-head span { display: block; font-size: 13px; line-height: 18px; color: var(--on-deep-muted); }
/* .chat-head .spark-badge, not .spark-badge: ".chat-head span" above would otherwise paint the badge text lavender on yellow. */
.chat-head .spark-badge { flex: none; background: var(--spark); color: var(--ink); font-size: 12px; line-height: 16px; font-weight: 600; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.chat-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.bubble { max-width: 88%; padding: 9px 13px; font-size: 15px; line-height: 24px; }
.bubble-customer { align-self: flex-start; background: var(--tint); border-radius: 20px 20px 20px 6px; }
.bubble-business { align-self: flex-end; background: var(--surface-raised); border: 1px solid var(--line); border-radius: 20px 20px 6px 20px; }
[dir="rtl"] .bubble-customer { border-radius: 20px 20px 6px 20px; }
[dir="rtl"] .bubble-business { border-radius: 20px 20px 20px 6px; }
.typing { display: inline-flex; gap: 5px; align-items: center; padding: 14px 16px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .4; animation: typing 1s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
.chat figcaption { font-size: 14px; line-height: 22px; color: var(--muted); }
@media (min-width: 640px) {
  .chat-head { padding: 16px 20px; }
  .chat-head strong { font-size: 16px; line-height: 24px; }
  .chat-head .spark-badge { font-size: 13px; line-height: 18px; padding: 6px 12px; }
  .chat-body { padding: 20px; gap: 12px; }
  .bubble { max-width: 85%; padding: 10px 14px; }
}
@media (min-width: 960px) { .chat { flex: 1 1 0; margin: 0; } }

/* Sections */
.band { background: var(--surface-raised); border-block: 1px solid var(--line); }
.section { padding-block: 48px; display: flex; flex-direction: column; gap: 24px; }
.section h2, .features h2, .faq h2 { font-size: 26px; line-height: 34px; font-weight: 600; }
html[lang="ar"] .section h2, html[lang="ar"] .features h2, html[lang="ar"] .faq h2 { line-height: 40px; }
.section h3 { font-size: 19px; line-height: 28px; font-weight: 600; }
@media (min-width: 640px) {
  .section { padding-block: 72px; gap: 32px; }
  .section h2, .features h2, .faq h2 { font-size: 32px; line-height: 40px; }
  html[lang="ar"] .section h2, html[lang="ar"] .features h2, html[lang="ar"] .faq h2 { line-height: 46px; }
  .section h3 { font-size: 20px; }
}

.segments { display: grid; grid-template-columns: 1fr; gap: 28px; }
.segment { display: flex; flex-direction: column; gap: 10px; }
.segment .bubble { max-width: 100%; align-self: flex-start; }
.segment .note { color: var(--muted); font-size: 15px; line-height: 24px; }
@media (min-width: 640px) { .segments { grid-template-columns: repeat(3, 1fr); gap: 24px; } }

.steps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr; gap: 28px; }
.steps li { display: flex; flex-direction: column; gap: 10px; }
.step-num { width: 44px; height: 44px; border-radius: 999px; background: var(--brand); color: var(--on-brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
@media (min-width: 960px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 32px; } }

.features { display: flex; flex-direction: column; gap: 8px; padding-block: 48px; }
.feature-list { min-width: 0; display: flex; flex-direction: column; }
.feature { padding-block: 18px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.feature:last-child { border-bottom: none; }
.feature p { color: var(--muted); }
@media (min-width: 640px) { .features { padding-block: 72px; gap: 16px; } .feature { padding-block: 20px; } }
@media (min-width: 960px) {
  .features { display: grid; grid-template-columns: 1fr 2fr; gap: 48px; align-items: start; }
}

.plans { display: grid; grid-template-columns: 1fr; gap: 16px; }
.plan { border-radius: var(--radius-lg); padding: 24px 20px; display: flex; flex-direction: column; gap: 16px; background: var(--surface-raised); border: 1px solid var(--line); }
.plan h3 { font-size: 22px; line-height: 30px; }
.plan .for { color: var(--muted); font-size: 15px; }
.plan .volume { font-size: 24px; line-height: 32px; font-weight: 700; }
.plan ul { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 8px; }
.plan .btn { margin-top: auto; width: 100%; }
.plan-featured { background: var(--brand-deep); color: var(--on-brand); border-color: var(--brand-deep); }
.plan-featured .for { color: var(--on-deep-muted); }
@media (min-width: 640px) {
  .plans { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .plan { padding: 32px; gap: 20px; }
  .plan h3 { font-size: 24px; line-height: 32px; }
  .plan .volume { font-size: 28px; line-height: 36px; }
}

.faq { max-width: 820px; margin: 0 auto; padding: 48px 16px; display: flex; flex-direction: column; }
.faq h2 { margin-bottom: 8px; }
.faq-item { padding-block: 18px; border-bottom: 1px solid var(--line); }
.faq-item:last-child { border-bottom: none; }
.faq-item h3 { font-size: 18px; line-height: 27px; font-weight: 600; margin-bottom: 6px; }
.faq-item p { color: var(--muted); }
@media (min-width: 640px) { .faq { padding: 72px 24px; } .faq h2 { margin-bottom: 16px; } .faq-item { padding-block: 20px; } .faq-item h3 { font-size: 19px; line-height: 28px; } }

/* Demo form */
.demo { padding-block: 32px 48px; }
.demo-band { background: var(--brand-deep); color: var(--on-brand); border-radius: var(--radius-lg); padding: 28px 16px 16px; display: flex; flex-direction: column; gap: 24px; }
.demo-intro { display: flex; flex-direction: column; gap: 12px; padding-inline: 4px; }
.demo-intro h2 { font-size: 26px; line-height: 34px; font-weight: 700; }
html[lang="ar"] .demo-intro h2 { line-height: 42px; }
.demo-intro p { color: var(--on-deep-muted); }
.demo-intro a { color: #FFFFFF; overflow-wrap: anywhere; }
.demo-card { min-width: 0; background: var(--surface-raised); color: var(--ink); border-radius: var(--radius-md); padding: 20px 16px; }
@media (min-width: 640px) {
  .demo { padding-block: 72px; }
  .demo-band { padding: 40px 32px; gap: 32px; }
  .demo-intro { gap: 16px; padding-inline: 0; }
  .demo-intro h2 { font-size: 32px; line-height: 40px; }
  html[lang="ar"] .demo-intro h2 { line-height: 46px; }
  .demo-card { padding: 32px; border-radius: var(--radius-lg); }
}
@media (min-width: 960px) {
  .demo-band { flex-direction: row; align-items: flex-start; padding: 48px 40px; gap: 40px; }
  .demo-intro { flex: 1 1 0; position: sticky; top: 96px; }
  .demo-card { flex: 1.3 1 0; }
}
.form { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
@media (min-width: 640px) { .form, .row { gap: 18px; } .row { flex-direction: row; } .row > .field { flex: 1 1 0; } }
.turnstile:empty { display: none; }
.field label { font-size: 14px; line-height: 20px; font-weight: 500; }
/* 16px text keeps iOS Safari from zooming into the field on focus. */
.field input, .field select, .field textarea { font: inherit; font-size: 16px; padding: 11px 14px; border: 1px solid var(--control-border); border-radius: var(--radius-sm); background: #FFFFFF; color: var(--ink); min-height: 48px; width: 100%; }
.field textarea { resize: vertical; min-height: 96px; }
.field input::placeholder { color: var(--muted); opacity: 1; }
.field .hint { font-size: 13px; line-height: 18px; color: var(--muted); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--danger); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 22px; color: var(--muted); }
.consent input { width: 22px; height: 22px; margin: 0; accent-color: var(--brand); flex: none; }
.hp { position: absolute; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form .btn[type="submit"] { width: 100%; }
.form-status { font-size: 15px; line-height: 24px; }
.form-status.error { color: var(--danger); }
.form-done { display: flex; flex-direction: column; gap: 12px; padding-block: 24px; }
.form-done h3 { font-size: 24px; line-height: 32px; font-weight: 600; }
.form-done p { color: var(--muted); }
.link-button { align-self: flex-start; background: none; border: none; color: var(--brand); font: inherit; font-weight: 500; padding: 12px 0; min-height: 44px; cursor: pointer; }
[hidden] { display: none !important; }

/* Footer */
.site-footer { background: var(--surface-raised); border-top: 1px solid var(--line); }
.site-footer .container { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding-block: 28px; font-size: 14px; line-height: 22px; color: var(--muted); }
.site-footer .wordmark { font-size: 20px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 20px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
@media (min-width: 640px) {
  .site-footer .container { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-block: 32px; }
  .footer-links { gap: 0 24px; }
}

/* Legal pages */
.legal { max-width: 760px; margin: 0 auto; padding: 32px 16px 56px; display: flex; flex-direction: column; gap: 18px; overflow-wrap: break-word; }
.legal h1 { font-size: 30px; line-height: 38px; font-weight: 700; }
.legal h2 { font-size: 21px; line-height: 29px; font-weight: 600; margin-top: 12px; }
.legal h3 { font-size: 18px; line-height: 26px; font-weight: 600; }
.legal ul { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 8px; }
.legal .updated { color: var(--muted); font-size: 14px; line-height: 22px; }
.legal .todo { background: var(--tint); border-radius: var(--radius-md); padding: 16px 20px; }
.legal .todo-inline { background: var(--tint); border-radius: var(--radius-sm); padding: 0 4px; }
.legal .note { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px; }
@media (min-width: 640px) {
  .legal { padding: 56px 24px 72px; gap: 20px; }
  .legal h1 { font-size: 40px; line-height: 48px; }
  .legal h2 { font-size: 24px; line-height: 32px; margin-top: 16px; }
  .legal h3 { font-size: 20px; line-height: 28px; }
  .legal .note { padding: 16px 20px; }
}

/* Motion. Only active when assets/motion.js has added html.motion, which it skips for prefers-reduced-motion. */
@keyframes typing { 0%, 60%, 100% { opacity: .4; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes bubble-in { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes badge-pop { 0% { opacity: 0; transform: scale(.6); } 70% { opacity: 1; transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
html.motion .chat-body .bubble:not(.shown) { display: none; }
html.motion .chat-body .bubble.shown { animation: bubble-in .35s ease-out both; }
html.motion .chat-head .spark-badge:not(.shown) { opacity: 0; }
html.motion .chat-head .spark-badge.shown { animation: badge-pop .45s ease-out both; }
html.motion .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease-out, transform .6s ease-out; }
html.motion .reveal.in { opacity: 1; transform: none; }
.btn { transition: background-color .15s, color .15s, border-color .15s, transform .15s, box-shadow .15s; }
@media (prefers-reduced-motion: no-preference) {
  .btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(46, 22, 120, .18); }
}
