/* ==========================================================================
   Hatli M3ak — website
   Palette and type deliberately mirror apps/customer/lib/config.ts and
   tailwind.config.js, so the site a reviewer opens from the App Store listing
   looks like the app they just installed.
   ========================================================================== */

@font-face {
  font-family: 'Clash Display';
  src: url('../fonts/ClashDisplay-Semibold.otf') format('opentype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Clash Display';
  src: url('../fonts/ClashDisplay-Bold.otf') format('opentype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('../fonts/Manrope-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('../fonts/Manrope-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('../fonts/Manrope-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}
/* Arabic. Manrope and Clash carry no Arabic glyphs, so without this every
   Arabic page would silently fall back to the system face. */
@font-face {
  font-family: 'Tajawal';
  src: url('../fonts/Tajawal-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Tajawal';
  src: url('../fonts/Tajawal-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --primary: #fed917;
  --primary-press: #efc900;
  --primary-wash: #fff9db;
  --on-primary: #14130a;
  --ink: #0f0f0f;
  --ink-soft: #1b1b1b;
  --bg: #ffffff;
  --surface: #f5f5f2;
  --secondary: #7a7a7a;
  --muted: #a3a3a3;
  --border: #ececec;
  --danger: #ef4444;
  --success: #16a34a;

  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Clash Display', var(--sans);
  --radius: 20px;
  --radius-lg: 28px;
  --maxw: 1080px;
}

/* Arabic swaps the whole stack — Tajawal for body and headings alike. */
html[lang='ar'] {
  --sans: 'Tajawal', system-ui, sans-serif;
  --display: 'Tajawal', system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--ink);
  text-decoration-color: var(--primary);
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-color: var(--ink);
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}
h1 {
  font-size: clamp(2rem, 6vw, 3.4rem);
}
h2 {
  font-size: clamp(1.5rem, 3.6vw, 2.1rem);
  margin-top: 2.2em;
}
h3 {
  font-size: 1.15rem;
  margin-top: 1.8em;
}
p,
li {
  margin: 0 0 1em;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}
.narrow {
  max-width: 760px;
}

/* Skip link — the first thing a keyboard user meets. */
.skip {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 0 0 12px 0;
  z-index: 100;
}
.skip:focus {
  inset-inline-start: 0;
}

/* ------------------------------------------------------------------ header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .bar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
}
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}
.nav {
  display: flex;
  gap: 6px;
  margin-inline-start: auto;
  align-items: center;
}
.nav a {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--secondary);
}
.nav a:hover,
.nav a[aria-current='page'] {
  background: var(--surface);
  color: var(--ink);
}

.lang {
  display: inline-flex;
  background: var(--surface);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.lang button {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--secondary);
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
}
.lang button[aria-pressed='true'] {
  background: var(--primary);
  color: var(--on-primary);
}

.menu-btn {
  display: none;
  margin-inline-start: auto;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: 9px 12px;
  cursor: pointer;
  font: inherit;
}

/* -------------------------------------------------------------------- hero */

.hero {
  background: var(--primary);
  padding: clamp(40px, 8vw, 84px) 0 clamp(48px, 9vw, 96px);
  position: relative;
  overflow: hidden;
}
.hero::after {
  /* Soft bloom, echoing the app's onboarding screens. */
  content: '';
  position: absolute;
  inset-inline-end: -140px;
  top: -160px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
}
.hero .grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 36px;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
}
.hero h1 {
  color: var(--on-primary);
}
.hero p.lead {
  font-size: 1.15rem;
  color: rgba(20, 19, 10, 0.72);
  max-width: 46ch;
}
.hero img {
  justify-self: center;
  width: 100%;
  max-width: 340px;
  /* The width/height attributes reserve the right box before the image loads;
     `auto` keeps the ratio once CSS caps the width. Without it the attribute
     height wins and the mascot renders squashed. */
  height: auto;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border-radius: 999px;
  padding: 14px 24px;
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
}
.btn-dark {
  background: var(--ink);
  color: #fff;
}
.btn-dark:hover {
  background: var(--ink-soft);
}
.btn-ghost {
  background: transparent;
  border-color: rgba(20, 19, 10, 0.28);
  color: var(--on-primary);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.45);
}
/* On white sections the yellow button needs dark ink — white on #FED917 is
   about 1.4:1 and unreadable. */
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}
.btn-primary:hover {
  background: var(--primary-press);
}

/* ---------------------------------------------------------------- sections */

section.band {
  padding: clamp(44px, 7vw, 78px) 0;
}
section.band.tint {
  background: var(--surface);
}
.section-head {
  max-width: 60ch;
  margin-bottom: 34px;
}
.section-head p {
  color: var(--secondary);
  margin: 0;
}

.cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.card img {
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
}
.card h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
}
.card p {
  margin: 0;
  color: var(--secondary);
  font-size: 0.94rem;
}

.steps {
  counter-reset: step;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  padding: 0;
  list-style: none;
}
.steps li {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin: 0;
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

/* ------------------------------------------------------------ legal pages */

.doc {
  padding: 44px 0 72px;
}
.doc .meta {
  color: var(--secondary);
  font-size: 0.92rem;
  margin-bottom: 2.4em;
}
.doc h2 {
  padding-top: 0.4em;
  border-top: 1px solid var(--border);
}
.doc ul {
  padding-inline-start: 1.25em;
}
.toc {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 2.4em;
}
.toc ol {
  margin: 0;
  padding-inline-start: 1.2em;
  columns: 2;
  column-gap: 28px;
}
.toc li {
  margin: 0 0 0.35em;
  font-size: 0.94rem;
}

/* A block the operator must complete before publishing. Loud on purpose —
   shipping a policy with the placeholders still in it looks unfinished to a
   reviewer, and this makes that impossible to miss. */
.placeholder {
  background: var(--primary-wash);
  border: 1.5px dashed var(--primary-press);
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 0.94rem;
}
.placeholder strong {
  display: block;
  margin-bottom: 4px;
}

.callout {
  background: var(--surface);
  border-inline-start: 4px solid var(--primary);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 1.6em 0;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0 2em;
  font-size: 0.95rem;
}
table.data th,
table.data td {
  text-align: start;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.data th {
  background: var(--surface);
  font-weight: 700;
}

/* ---------------------------------------------------------------- support */

.contact-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin: 26px 0;
}
.contact-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.contact-card a {
  font-weight: 700;
  font-size: 1.05rem;
}

details.faq {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0 18px;
  margin-bottom: 10px;
}
details.faq summary {
  cursor: pointer;
  font-weight: 700;
  padding: 16px 0;
  list-style: none;
}
details.faq summary::-webkit-details-marker {
  display: none;
}
details.faq summary::after {
  content: '+';
  float: inline-end;
  font-weight: 400;
  color: var(--secondary);
}
details.faq[open] summary::after {
  content: '–';
}
details.faq p {
  margin-top: 0;
  color: var(--secondary);
}

/* ----------------------------------------------------------------- footer */

.site-footer {
  background: var(--ink);
  color: #fff;
  padding: 48px 0 32px;
  margin-top: 40px;
}
.site-footer a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
}
.site-footer a:hover {
  color: #fff;
  text-decoration: underline;
}
.footer-grid {
  display: grid;
  gap: 26px;
  /* Brand column plus three link columns. `auto-fit` rather than a fixed count
     so a future column does not silently overflow the row. */
  grid-template-columns: 1.6fr repeat(auto-fit, minmax(140px, 1fr));
}
.footer-grid h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 12px;
}
.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-grid li {
  margin-bottom: 8px;
  font-size: 0.95rem;
}
.legal-line {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 32px;
  padding-top: 20px;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 860px) {
  .hero .grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .hero img {
    max-width: 240px;
    order: -1;
  }
  .toc ol {
    columns: 1;
  }
  .menu-btn {
    display: block;
  }
  .nav {
    display: none;
    position: absolute;
    top: 68px;
    inset-inline: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 10px 20px 16px;
    gap: 2px;
  }
  .nav.open {
    display: flex;
  }
  .nav a {
    padding: 12px;
  }
  .lang {
    align-self: flex-start;
    margin-top: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Printing a policy is a real thing people do before signing anything. */
@media print {
  .site-header,
  .site-footer,
  .lang,
  .menu-btn {
    display: none !important;
  }
  body {
    font-size: 12pt;
  }
}

/* ------------------------------------------------------------------- forms */

.field {
  margin-bottom: 18px;
}
.field label {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 6px;
}
/* Not scoped to .field — the same small print is used under the form itself. */
.hint {
  color: var(--secondary);
  font-size: 0.86rem;
  margin: 6px 0 0;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}
.field textarea {
  min-height: 150px;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 3px solid rgba(254, 217, 23, 0.55);
  outline-offset: 1px;
  border-color: var(--ink);
}
.field input[aria-invalid='true'],
.field textarea[aria-invalid='true'],
.field select[aria-invalid='true'] {
  border-color: var(--danger);
}
.field .err {
  color: var(--danger);
  font-size: 0.86rem;
  margin: 6px 0 0;
  font-weight: 600;
}

/* The honeypot. Off-screen rather than display:none, because some bots skip
   fields they can tell are hidden. Also hidden from assistive tech, so a
   screen-reader user is never asked to fill it in. */
.hp {
  position: absolute;
  inset-inline-start: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 600;
  margin-bottom: 18px;
}
.form-status.ok {
  background: rgba(22, 163, 74, 0.1);
  color: var(--success);
}
.form-status.bad {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

button.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
