/* Public website (docs/design/web, W1–W4.9). Colours and radii from docs/brand/tokens.json;
   --primary and --accent are replaced by the tenant's color_primary / color_accent in the layout.
   Logical properties keep one stylesheet for Arabic (RTL) and English (LTR). */
:root {
  --primary: #0F766E; --primary-50: #EBF7F5; --primary-100: #CFEBE7; --primary-300: #7FC8C0; --primary-700: #0C5F59; --primary-900: #073532;
  --accent: #5B7DB1; --accent-100: #E8EEF7; --accent-700: #3B5586;
  --ink: #1F2F3A; --body: #334155; --muted: #52656D; --line: #E1E6EE; --surface: #F5F7FA; --card: #FFFFFF;
  --success: #16A34A; --success-bg: #DCFCE7; --warn: #D97706; --warn-bg: #FEF3C7; --danger: #DC2626; --danger-bg: #FEE2E2;
  --radius-control: 8px; --radius-card: 16px; --radius-block: 24px; --radius-chip: 20px;
  --font: 'IBM Plex Sans Arabic', Tahoma, Arial, sans-serif; --mono: 'IBM Plex Mono', Menlo, Consolas, monospace;
  --shadow: 0 24px 48px -24px rgba(15, 47, 58, .18);
  color-scheme: light;
}
html[lang="en"] { --font: 'Plus Jakarta Sans', Helvetica, Arial, sans-serif; }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--body); background: var(--card); line-height: 1.7; font-size: 16px; }
h1, h2, h3 { color: var(--ink); line-height: 1.25; margin: 0; font-weight: 700; }
a { color: var(--primary); }
img { max-width: 100%; }
code, .mono { font-family: var(--mono); font-size: .95em; }
.container { width: 100%; max-width: 1312px; margin-inline: auto; padding-inline: 32px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 36px; height: 36px; border-radius: 27%; background: var(--primary); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 22px; height: 22px; }
.brand-name { display: grid; line-height: 1.1; }
.brand-name strong { font-size: 18px; }
.brand-name small { font-size: 11px; color: var(--muted); font-family: 'Plus Jakarta Sans', Helvetica, Arial, sans-serif; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 12px; font: inherit; font-weight: 700; text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-700); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-danger-soft { background: var(--danger-bg); color: #B91C1C; }
.btn-block { width: 100%; }
.btn-sm { min-height: 42px; padding: 0 20px; font-size: 15px; }

/* Official store badges (components/store-badges.blade.php), used unmodified: same height,
   width auto, clear space of at least a quarter of the height, never below 40px. */
.store-badges { --badge-h: 52px; display: flex; flex-wrap: wrap; gap: max(12px, calc(var(--badge-h) / 4)); padding-block: calc(var(--badge-h) / 4); }
.store-badge { display: inline-block; line-height: 0; }
.store-badge img { display: block; height: var(--badge-h); width: auto; min-height: 40px; }

/* Header (full) */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.4) blur(8px); }
.site-header .container { display: flex; align-items: center; gap: 24px; height: 76px; }
.site-nav { display: flex; gap: 30px; margin-inline: auto; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 15px; }
.site-nav a:hover { color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.lang-pill { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; direction: ltr; }
.lang-pill a { display: grid; place-items: center; min-width: 34px; height: 32px; padding: 0 8px; font-size: 13px; font-weight: 700; text-decoration: none; color: var(--muted); font-family: var(--mono); }
.lang-pill a[aria-current="true"] { background: var(--primary); color: #fff; }
.menu { display: none; position: relative; }
.menu summary { list-style: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; inset-inline-end: 0; top: 52px; width: min(320px, calc(100vw - 32px)); background: #fff; border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); padding: 12px; display: grid; gap: 2px; }
.menu-panel a { padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
.menu-panel a:hover { background: var(--surface); }

/* Sections */
section { padding-block: 96px; }
.section-surface { background: var(--surface); }
.eyebrow { display: block; color: var(--primary); font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.section-head h2 { font-size: 40px; }
.section-head p { color: var(--muted); margin: 12px 0 0; font-size: 17px; }

/* Hero */
.hero { background: linear-gradient(180deg, var(--primary-50) 0%, #fff 100%); padding-block: 72px 48px; }
.hero .container { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--primary-700); font-weight: 700; font-size: 13px; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.hero h1 { font-size: 64px; margin: 22px 0 20px; letter-spacing: -.01em; }
.hero p.lead { font-size: 20px; color: var(--body); margin: 0 0 28px; max-width: 34em; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 28px; list-style: none; margin: 24px 0 0; padding: 0; color: var(--muted); font-size: 15px; }
.checks li { display: inline-flex; align-items: center; gap: 8px; }
.checks li::before { content: "✓"; color: var(--success); font-weight: 700; }
.hero-art { position: relative; min-height: 580px; }
.hero-art .slab { position: absolute; inset: 40px 0 0 0; background: var(--primary); border-radius: 36px; box-shadow: var(--shadow); }
.hero-art .slab { inset: 64px 0 24px 0; }
.hero-art .phone:nth-child(2) { position: absolute; inset-inline-end: 6%; top: 0; width: 40%; }
.hero-art .phone:nth-child(3) { position: absolute; inset-inline-start: 6%; top: 84px; width: 40%; }

/* Phone frame with a screenshot slot (striped until real app screenshots are added). */
.phone { aspect-ratio: 9 / 19.5; border: 8px solid #1d2329; border-radius: 34px; background: repeating-linear-gradient(135deg, #eef1f6 0 18px, #e3e7ee 18px 36px); overflow: hidden; box-shadow: var(--shadow); }
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }

/* Stats */
.stats { padding-block: 64px; }
.stats ul { display: flex; justify-content: center; gap: 72px; list-style: none; margin: 0; padding: 0; text-align: center; }
.stats b { display: block; font-family: var(--mono); font-size: 40px; color: var(--primary); line-height: 1.1; }
.stats span { color: var(--muted); font-size: 15px; }

/* Features */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 28px; }
.feature .icon { width: 52px; height: 52px; border-radius: 14px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; margin-bottom: 18px; }
.feature .icon.accent { background: var(--accent-100); color: var(--accent-700); }
.feature .icon svg { width: 26px; height: 26px; }
.feature h3 { font-size: 20px; margin-bottom: 8px; }
.feature p { margin: 0; color: var(--muted); }

/* How it works */
.step .shot { background: var(--primary-50); border-radius: var(--radius-block); padding: 34px 0 0; overflow: hidden; height: 300px; display: grid; justify-items: center; }
.step .shot .phone { width: 200px; border-bottom: 0; border-radius: 34px 34px 0 0; box-shadow: none; }
.step .num { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; display: grid; place-items: center; margin: 20px auto 16px; font-family: var(--mono); }
.step { text-align: center; }
.step h3 { font-size: 20px; margin-bottom: 8px; }
.step p { color: var(--muted); margin: 0 auto; max-width: 22em; }

/* Family */
.family { background: var(--accent-100); border-radius: var(--radius-block); padding: 64px; display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.family .eyebrow { color: var(--accent-700); }
.family h2 { font-size: 40px; margin-bottom: 16px; }
.family p { font-size: 17px; margin: 0 0 24px; }
.roles { display: grid; gap: 12px; list-style: none; margin: 0; padding: 0; }
.roles li { background: #fff; border-radius: 14px; padding: 14px 16px; display: flex; align-items: center; gap: 14px; }
.chip { display: inline-flex; padding: 4px 12px; border-radius: var(--radius-chip); background: var(--accent-100); color: var(--accent-700); font-weight: 700; font-size: 13px; white-space: nowrap; }
.family .phone { width: 280px; margin-inline: auto; }

/* Privacy */
.privacy { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: start; }
.privacy h2 { font-size: 40px; margin-bottom: 20px; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; font-size: 17px; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; }
.ticks li::before { content: "✓"; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--success-bg); color: var(--success); display: grid; place-items: center; font-size: 13px; font-weight: 700; margin-top: 2px; }
.notice { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 28px 32px; }
.notice h3 { font-size: 18px; margin-bottom: 10px; }
.notice p { margin: 0; }

/* Download CTA */
.cta { background: var(--primary); color: #fff; border-radius: var(--radius-block); padding: 64px; display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; }
.cta h2 { color: #fff; font-size: 44px; margin-bottom: 12px; }
.cta p { margin: 0 0 24px; font-size: 18px; color: rgba(255,255,255,.9); }
.qr { display: flex; align-items: center; gap: 20px; color: rgba(255,255,255,.92); font-size: 14px; font-weight: 600; max-width: 22em; }
.qr-box { width: 168px; height: 168px; background: #fff; border-radius: 18px; padding: 14px; flex: none; }
.qr-box svg { display: block; width: 100%; height: 100%; }

/* FAQ */
.faq { max-width: 860px; margin-inline: auto; display: grid; gap: 12px; }
.faq details { border: 1px solid var(--line); border-radius: var(--radius-card); background: #fff; }
.faq summary { list-style: none; cursor: pointer; padding: 22px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; font-weight: 700; color: var(--ink); font-size: 18px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); color: var(--ink); display: grid; place-items: center; font-weight: 400; font-size: 20px; }
.faq details[open] summary::after { content: "−"; background: var(--primary); color: #fff; }
.faq details p { margin: 0; padding: 0 24px 22px; color: var(--muted); }

/* Footer (full) */
.site-footer { background: var(--primary-900); color: rgba(255,255,255,.85); padding-block: 56px 28px; font-size: 14px; }
.site-footer a { color: rgba(255,255,255,.85); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.footer-grid h4 { color: #fff; margin: 0 0 12px; font-size: 15px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-brand .brand { color: #fff; margin-bottom: 14px; }
.footer-brand .brand-mark { background: var(--primary); }
.footer-brand .brand-name small { color: rgba(255,255,255,.6); }
.footer-brand p { margin: 0 0 18px; max-width: 28em; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.14); margin-top: 40px; padding-top: 20px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-bottom .mono { direction: ltr; }

/* Legal pages */
.legal-head { background: var(--surface); border-bottom: 1px solid var(--line); padding-block: 56px; }
.legal-head h1 { font-size: 48px; margin: 6px 0 12px; }
.legal-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; color: var(--muted); font-size: 14px; }
.draft { background: var(--warn-bg); color: #92400E; border-radius: 999px; padding: 3px 12px; font-weight: 700; font-size: 13px; }
.legal { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 56px; padding-block: 48px 88px; }
.legal-body { max-width: 760px; }
.legal-body h2 { font-size: 24px; margin: 36px 0 12px; scroll-margin-top: 96px; }
.legal-body h2:first-child { margin-top: 0; }
.legal-body p, .legal-body li { font-size: 16.5px; }
.legal-body ul { padding-inline-start: 22px; }
.legal-body li { margin-bottom: 8px; }
.legal-body .value { background: var(--primary-50); border-radius: 4px; padding: 0 4px; }
.toc { position: sticky; top: 100px; align-self: start; order: -1; }
.toc h4 { margin: 0 0 10px; font-size: 13px; color: var(--muted); padding-inline-start: 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: block; padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--body); font-size: 14px; }
.toc a:hover { background: var(--primary-50); color: var(--primary-700); }

/* Compact pages (W4): small header, one card, link footer */
.compact { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; background: var(--surface); }
.compact-header { background: #fff; border-bottom: 1px solid var(--line); }
.compact-header .container { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.compact-header .lang-link { color: var(--muted); font-weight: 700; text-decoration: none; font-size: 14px; }
.compact main { display: grid; place-items: center; padding: 56px 16px; }
.panel { width: 100%; max-width: 480px; background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 40px; }
.panel-wide { max-width: 520px; }
.panel h1 { font-size: 26px; margin-bottom: 14px; }
.panel p { margin: 0 0 18px; color: var(--muted); }
.panel.center { text-align: center; }
.status-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 18px; font-size: 30px; font-weight: 700; }
.status-icon.ok { background: var(--success-bg); color: var(--success); }
.status-icon.warn { background: var(--warn-bg); color: #B45309; }
.invite-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: 22px; flex: none; }
.invite-head h1 { font-size: 22px; margin: 0; }
.invite-head small { color: var(--muted); font-size: 14px; }
.panel .store-badges { justify-content: center; margin-top: 8px; }
.panel .fine { text-align: center; font-size: 13px; color: var(--muted); margin: 18px 0 0; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 700; font-size: 14px; color: var(--ink); }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font: inherit; color: var(--ink); background: #fff; }
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }
.field input[type="email"] { font-family: var(--mono); direction: ltr; text-align: start; }
html[dir="rtl"] .field input[type="email"] { text-align: right; }
.field .hint { font-size: 13px; color: var(--muted); }
.field .error, .alert-error { color: #B91C1C; font-size: 14px; }
.alert { border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: 15px; }
.alert-ok { background: var(--success-bg); color: #166534; }
.alert-error { background: var(--danger-bg); }
.from-app { background: var(--surface); border-radius: 14px; padding: 14px 16px; margin-bottom: 18px; }
.from-app b { display: block; color: var(--ink); font-size: 15px; }
.from-app span { font-size: 14px; color: var(--muted); }
.or { font-weight: 700; color: var(--ink); margin: 0 0 10px; }
.honeypot { position: absolute; inset-inline-start: -10000px; }
.support { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; width: 100%; max-width: 840px; align-items: start; }
.support .panel { max-width: none; }
.topics { display: grid; gap: 10px; }
.topics details { border: 1px solid var(--line); border-radius: 14px; }
.topics summary { cursor: pointer; padding: 12px 16px; font-weight: 700; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.topics summary::-webkit-details-marker { display: none; }
.topics summary::after { content: "‹"; color: var(--muted); font-weight: 400; transition: transform .15s; }
html[dir="ltr"] .topics summary::after { content: "›"; }
.topics details[open] summary::after { transform: rotate(-90deg); }
.topics details p { padding: 0 16px 14px; margin: 0; font-size: 15px; }
.big-404 { font-family: var(--mono); font-size: 112px; font-weight: 700; color: var(--primary-100); line-height: 1; margin-bottom: 12px; }
.compact-footer { display: flex; justify-content: center; gap: 22px; padding: 22px 16px 26px; font-size: 13px; }
.compact-footer a { color: var(--muted); text-decoration: none; }

/* Responsive */
@media (max-width: 1080px) {
  .site-nav { display: none; }
  .menu { display: block; }
  .header-actions .btn, .header-actions .lang-pill { display: none; }
  .header-actions { margin-inline-start: auto; }
  .hero .container, .family, .privacy, .cta, .legal { grid-template-columns: 1fr; }
  .hero { text-align: center; }
  .hero .store-badges, .checks { justify-content: center; }
  .hero p.lead { margin-inline: auto; }
  .hero-art { min-height: 0; width: 100%; max-width: 300px; margin: 16px auto 0; }
  .hero-art .slab, .hero-art .phone:nth-child(3) { display: none; }
  .hero-art .phone:nth-child(2) { position: static; width: 100%; }
  .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .toc { display: none; }
  .cta { text-align: center; }
  .cta .store-badges { justify-content: center; }
  .qr { display: none; }
}
@media (max-width: 760px) {
  .support { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .container { padding-inline: 16px; }
  section { padding-block: 64px; }
  .hero h1 { font-size: 40px; }
  .hero p.lead { font-size: 17px; }
  .section-head h2, .family h2, .privacy h2 { font-size: 30px; }
  .stats ul { flex-wrap: wrap; gap: 28px 40px; }
  .family, .cta { padding: 32px 20px; border-radius: 20px; }
  .cta h2 { font-size: 32px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .legal-head h1 { font-size: 34px; }
  .panel { padding: 28px 20px; }
  .store-badges { --badge-h: 48px; justify-content: center; }
}
