/* Landing page — same tokens as the dashboard (src/styles/tokens.css, light theme). */
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url('fonts/plex-arabic-400.woff2') format('woff2'); font-weight: 400 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url('fonts/plex-arabic-600.woff2') format('woff2'); font-weight: 600 700; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #F3F7F7; --card: #FFFFFF; --soft: #F7FAFA; --line: #E8EEEE; --line-strong: #7F9397;
  --text: #18212B; --text2: #5F6B78;
  --teal: #087F83; --on-teal: #FFFFFF; --teal-ink: #066569; --teal-50: #E6F3F3; --c-teal-soft: #BFE3E3;
  --blue-bg: #DDF5FC; --blue-ink: #0A5C7A; --green-bg: #DDF8E9; --green-ink: #0E6B3C; --purple-bg: #EEE6FF; --purple-ink: #5B3FB5;
  --danger: #A32626; --danger-bg: #FDE8E8;
  --shadow: 0 1px 2px rgba(16, 40, 40, .04), 0 10px 28px rgba(16, 40, 40, .05);
  --scrim: rgba(16, 30, 32, .45);
  --font: 'IBM Plex Sans Arabic', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --r-md: 14px; --r-lg: 18px; --r-xl: 24px; --r-pill: 999px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.is-locked, html.is-locked body { overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.75; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input { font-family: inherit; font-size: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.wrap { width: min(100%, 1040px); margin-inline: auto; padding: 28px 20px calc(36px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 28px; }

/* ───── hero ───── */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; padding-top: 8px; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.brand__logo { width: 112px; height: 112px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 0 7px var(--teal-50), 0 0 0 8px var(--c-teal-soft), var(--shadow); background: #fff; }
.brand__name { font-weight: 600; font-size: 17px; line-height: 1.4; display: flex; flex-direction: column; }
.brand__name span { font-weight: 400; font-size: 14px; color: var(--text2); }
h1 { font-size: 31px; line-height: 1.4; font-weight: 600; letter-spacing: 0; max-width: 16em; }
.lead { color: var(--text2); font-size: 16.5px; max-width: 34em; }
.hint { color: var(--text2); font-size: 14px; }

/* ───── buttons ───── */
.btn { appearance: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 14px; font-weight: 600; transition: background-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease); -webkit-tap-highlight-color: transparent; }
.btn--primary { background: var(--teal); color: var(--on-teal); box-shadow: 0 8px 20px rgba(8, 127, 131, .24); }
.btn--primary:hover { background: var(--teal-ink); }
.btn--primary:active { transform: translateY(1px); }
.btn--xl { min-height: 56px; width: 100%; max-width: 420px; font-size: 17.5px; border-radius: 16px; }
.btn--ghost { background: transparent; color: var(--teal-ink); }
.btn--ghost:hover { background: var(--teal-50); }
.btn[disabled] { opacity: .7; cursor: progress; box-shadow: none; }
.btn:focus { outline: 3px solid rgba(8, 127, 131, .35); outline-offset: 2px; }
.btn:focus:not(:focus-visible) { outline: none; }

/* ───── cards and sections ───── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow); padding: 24px 22px; }
h2 { font-size: 18px; line-height: 1.5; font-weight: 600; }
.steps h2 { margin-bottom: 18px; }
.steps__list { display: flex; flex-direction: column; }
.steps__list li { position: relative; display: flex; gap: 14px; padding-bottom: 20px; }
.steps__list li:last-child { padding-bottom: 0; }
.steps__list li:not(:last-child)::before { content: ''; position: absolute; inset-inline-start: 17px; top: 40px; bottom: 4px; width: 2px; background: var(--line); }
.steps__n { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--teal-50); color: var(--teal-ink); font-weight: 600; font-size: 16px; }
.steps h3 { font-size: 16px; line-height: 1.5; font-weight: 600; margin-bottom: 2px; }
.steps p { color: var(--text2); font-size: 14.5px; line-height: 1.7; }

.levels { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.levels h2 { font-size: 16px; color: var(--text2); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.chip { padding: 8px 18px; border-radius: var(--r-pill); font-weight: 600; font-size: 15px; line-height: 1.5; }
.chip--blue { background: var(--blue-bg); color: var(--blue-ink); }
.chip--green { background: var(--green-bg); color: var(--green-ink); }
.chip--purple { background: var(--purple-bg); color: var(--purple-ink); }

.closing { display: flex; justify-content: center; }
.foot { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; color: var(--text2); font-size: 13px; line-height: 1.7; padding-top: 4px; }

/* ───── dialog (a div, so it also works in old in-app browsers) ───── */
.dlg { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.dlg__scrim { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: var(--scrim); animation: fade .18s ease-out; }
.dlg__panel { position: relative; width: 100%; max-height: 94vh; max-height: 94dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; background: var(--card); border-radius: 24px 24px 0 0; padding: 26px 20px calc(22px + env(safe-area-inset-bottom)); animation: rise .24s var(--ease); outline: none; }
.dlg__x { position: absolute; top: 12px; inset-inline-start: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--soft); color: var(--text2); display: grid; place-items: center; cursor: pointer; }
.dlg__x:hover { background: var(--teal-50); color: var(--teal-ink); }
.dlg__x:focus { outline: 3px solid rgba(8, 127, 131, .35); outline-offset: 1px; }
.dlg__title { font-size: 21px; line-height: 1.45; font-weight: 600; padding-inline-start: 48px; }
.dlg__sub { color: var(--text2); font-size: 14.5px; margin-top: 2px; padding-inline-start: 48px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: .6; } }

.form { display: flex; flex-direction: column; gap: 16px; }
.form .dlg__sub { margin-top: -12px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > label, .field > legend { font-weight: 600; font-size: 14.5px; line-height: 1.5; padding: 0; }
.field > legend { margin-bottom: 8px; }
.field input[type='text'], .field input[type='tel'] { width: 100%; min-height: 50px; padding: 0 14px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: #fff; font-size: 16px; transition: border-color .15s, box-shadow .15s; }
.field input::placeholder { color: #8A96A0; }
.field input[type='tel'] { text-align: right; }
.field input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(8, 127, 131, .18); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.help { color: var(--text2); font-size: 13px; }
.err { color: var(--danger); font-size: 13.5px; line-height: 1.55; font-weight: 600; }
.err:empty { display: none; }
.err--form { background: var(--danger-bg); border-radius: 12px; padding: 10px 14px; }
.is-bad > input[type='text'], .is-bad > input[type='tel'] { border-color: var(--danger); }
.is-bad > input:focus { box-shadow: 0 0 0 4px rgba(163, 38, 38, .16); }

.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt { position: relative; display: block; }
.opt input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.opt span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 48px; padding: 6px 10px; border: 1.5px solid var(--line-strong); border-radius: 12px; font-weight: 600; font-size: 15px; line-height: 1.4; background: #fff; transition: background-color .15s, border-color .15s, color .15s; }
.opt input:checked + span { background: var(--teal-50); border-color: var(--teal); color: var(--teal-ink); box-shadow: inset 0 0 0 1px var(--teal); }
.opt input:focus-visible + span { outline: 3px solid rgba(8, 127, 131, .35); outline-offset: 2px; }
.is-bad .opt span { border-color: var(--danger); }

.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.consent { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; cursor: pointer; font-size: 14.5px; line-height: 1.65; }
.consent input { flex: none; width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--teal); cursor: pointer; }
.consent small { display: block; color: var(--text2); font-size: 13px; margin-top: 2px; }
.is-bad .consent { color: var(--danger); }
.form .btn--xl { max-width: none; margin-top: 4px; }

.done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 12px 0 4px; }
.done__icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--green-bg); color: var(--green-ink); margin-bottom: 4px; }
.done .dlg__title, .done .dlg__sub { padding-inline-start: 0; }
.done .dlg__title { font-size: 20px; outline: none; }
.done .btn--xl { max-width: none; }
.ltr { direction: ltr; unicode-bidi: isolate; font-weight: 600; }

/* ───── wider screens ───── */
@media (min-width: 640px) {
  .dlg { align-items: center; padding: 24px; }
  .dlg__panel { width: 520px; max-height: 90vh; border-radius: 24px; padding: 30px 28px 26px; box-shadow: 0 24px 60px rgba(16, 30, 32, .28); }
  .dlg__title { font-size: 22px; }
}
@media (min-width: 900px) {
  .wrap { padding-top: 56px; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; column-gap: 64px; row-gap: 32px; }
  .hero { grid-column: 1; grid-row: 1 / span 2; align-items: flex-start; text-align: start; gap: 22px; }
  .brand { flex-direction: row; gap: 18px; }
  .brand__name { font-size: 19px; }
  h1 { font-size: 44px; line-height: 1.35; }
  .lead { font-size: 18px; }
  .btn--xl { width: auto; min-width: 280px; }
  .steps { grid-column: 2; grid-row: 1; padding: 30px 28px; }
  .levels { grid-column: 2; grid-row: 2; align-items: flex-start; text-align: start; }
  .chips { justify-content: flex-start; }
  .closing { display: none; }
  .foot { grid-column: 1 / -1; }
}
@media (max-width: 360px) {
  h1 { font-size: 27px; }
  .row2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
