@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url('/fonts/cairo-arabic-wght-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url('/fonts/cairo-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --bg: #f6f1e7;
  --surface: #ffffff;
  --surface-2: #fbf8f2;
  --ink: #17211c;
  --muted: #4f5c55;
  --line: #e3d9c6;
  --green: #0b5d3b;
  --green-dark: #08452c;
  --green-soft: #e3f1e9;
  --brass: #e2b04a;
  --brass-soft: #fbf0d6;
  --terra: #b23a26;
  --terra-soft: #fbe7e2;
  --amber: #8a5a00;
  --amber-soft: #fff3d6;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(23, 33, 28, .06), 0 6px 20px rgba(23, 33, 28, .07);
  --tap: 58px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Cairo', 'Segoe UI', Tahoma, system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.7;
  min-height: 100vh;
  min-height: 100dvh;
}
img { max-width: 100%; display: block; }
a { color: var(--green); font-weight: 700; }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .4em; }
h1 { font-size: 1.75rem; font-weight: 900; }
h2 { font-size: 1.45rem; font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 800; }
p { margin: 0 0 .8em; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.inline-ic { width: 18px; height: 18px; display: inline-block; vertical-align: -3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.topbar {
  background: var(--green) url('/img/zellige.svg');
  color: #fff;
  padding: 10px 16px;
  position: sticky; top: 0; z-index: 10;
  box-shadow: 0 2px 0 var(--brass);
}
.topbar-in { max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 10px; min-height: 48px; }
.admin .topbar-in { max-width: 1120px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 900; font-size: 1.35rem; }
.brand img { width: 40px; height: 40px; border-radius: 11px; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.brand small { font-weight: 600; font-size: .8rem; opacity: .85; display: block; line-height: 1; }
.topbar .spacer { flex: 1; }
.topbar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.35); min-height: 44px; padding: 6px 14px; font-size: .95rem; }

/* ---------- layout ---------- */
main { max-width: 560px; margin: 0 auto; padding: 20px 16px 120px; }
.admin main { max-width: 1120px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 18px;
  box-shadow: var(--shadow);
}
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }

/* ---------- buttons ---------- */
.btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--tap);
  padding: 10px 22px;
  border-radius: 16px;
  border: 2px solid transparent;
  font: inherit; font-weight: 800; font-size: 1.1rem;
  cursor: pointer; text-decoration: none;
  transition: transform .08s ease, background-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid var(--brass); outline-offset: 2px;
}
.btn svg { width: 24px; height: 24px; flex: none; }
.btn-block { display: flex; width: 100%; }
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 4px 0 var(--green-dark); }
.btn-primary:active { box-shadow: 0 1px 0 var(--green-dark); transform: translateY(3px); }
.btn-gold { background: var(--brass); color: #2b1d00; box-shadow: 0 4px 0 #b8862a; }
.btn-secondary { background: var(--surface); color: var(--green); border-color: var(--green); }
.btn-ghost { background: transparent; color: var(--green); border-color: var(--line); }
.btn-danger { background: var(--terra); color: #fff; box-shadow: 0 4px 0 #7f2618; }
.btn-danger-outline { background: var(--surface); color: var(--terra); border-color: var(--terra); }
.btn-small { min-height: 44px; padding: 6px 14px; font-size: .95rem; border-radius: 12px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }
.btn .spinner { width: 22px; height: 22px; border-width: 3px; }

.linkbtn { background: none; border: 0; padding: 8px 4px; font: inherit; color: var(--green); font-weight: 800; cursor: pointer; text-decoration: underline; min-height: 44px; }

/* ---------- forms ---------- */
label.field { display: block; }
.field > span.lbl { display: block; font-weight: 800; margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%;
  min-height: var(--tap);
  border: 2px solid var(--line);
  background: var(--surface);
  border-radius: 14px;
  padding: 10px 14px;
  font: inherit; font-size: 1.15rem; color: var(--ink);
}
textarea.input { min-height: 110px; resize: vertical; line-height: 1.6; }
.input:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px rgba(11,93,59,.18); }
.input[aria-invalid="true"] { border-color: var(--terra); }
.input.ltr-input { direction: ltr; text-align: left; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-left: 64px; }
.pw-toggle {
  position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  width: 50px; height: 46px; border: 0; background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer; border-radius: 10px;
}
.pw-toggle svg { width: 26px; height: 26px; }
.hint { color: var(--muted); font-size: .95rem; margin-top: 6px; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 12px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.check input { width: 28px; height: 28px; flex: none; accent-color: var(--green); margin: 2px 0 0; }

.alert { border-radius: 14px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-weight: 700; }
.alert svg { width: 24px; height: 24px; flex: none; margin-top: 2px; }
.alert-error { background: var(--terra-soft); color: #7a2414; border: 1px solid #f0c3b8; }
.alert-ok { background: var(--green-soft); color: var(--green-dark); border: 1px solid #bfdccc; }
.alert-info { background: var(--brass-soft); color: #5b4100; border: 1px solid #efd9a1; }

/* ---------- spinner / loading ---------- */
.spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 4px solid rgba(11,93,59,.18); border-top-color: var(--green);
  animation: spin .8s linear infinite; display: inline-block;
}
.btn-primary .spinner, .btn-danger .spinner { border-color: rgba(255,255,255,.35); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; gap: 12px; padding: 60px 0; color: var(--muted); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } .btn { transition: none; } }

/* ---------- landing ---------- */
.hero {
  background: var(--green) url('/img/zellige.svg');
  color: #fff;
  border-radius: 26px;
  padding: 30px 20px 26px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow);
}
.hero::after {
  content: ''; position: absolute; inset: auto auto -80px -60px; width: 170px; height: 190px;
  border-radius: 95px 95px 0 0; border: 14px solid rgba(226,176,74,.55); border-bottom: 0;
}
.hero h1 { font-size: 2rem; position: relative; z-index: 1; }
.hero p { font-size: 1.15rem; opacity: .95; position: relative; z-index: 1; max-width: 26ch; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; font-weight: 800; }
.steps .num { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--brass-soft); color: var(--green-dark); flex: none; }
.steps .num svg { width: 28px; height: 28px; }
.steps small { display: block; font-weight: 600; color: var(--muted); }

/* ---------- wizard ---------- */
.wiz-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.back-btn { width: 52px; height: 52px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink); flex: none; }
.back-btn svg { width: 28px; height: 28px; }
.progress { flex: 1; }
.progress-label { font-weight: 800; font-size: .95rem; color: var(--muted); }
.progress-bar { height: 12px; background: #e9e0cf; border-radius: 99px; overflow: hidden; margin-top: 4px; }
.progress-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brass), var(--green)); border-radius: 99px; transition: width .3s ease; }
.step-icon { width: 76px; height: 76px; border-radius: 22px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; margin-bottom: 12px; }
.step-icon svg { width: 42px; height: 42px; }
.step-icon.terra { background: var(--terra-soft); color: var(--terra); }
.step-icon.amber { background: var(--amber-soft); color: var(--amber); }
.step-icon.big { width: 104px; height: 104px; border-radius: 52px; margin-inline: auto; }
.step-icon.big svg { width: 56px; height: 56px; }
.sticky-actions {
  position: fixed; inset: auto 0 0 0; z-index: 9;
  background: linear-gradient(180deg, rgba(246,241,231,0), var(--bg) 30%);
  padding: 24px 16px calc(14px + env(safe-area-inset-bottom));
}
.sticky-actions > div { max-width: 560px; margin: 0 auto; display: grid; gap: 10px; }
.date-grid { display: grid; grid-template-columns: 1fr 1.6fr 1.3fr; gap: 8px; }
.date-grid select { padding-inline: 8px; font-size: 1.05rem; }
.phone-row { display: grid; grid-template-columns: 1fr; gap: 10px; }
.e164 { font-weight: 800; font-size: 1.2rem; color: var(--green-dark); }

.tips { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.tips li { display: flex; gap: 8px; align-items: center; font-weight: 700; color: var(--muted); }
.tips li svg { width: 22px; height: 22px; color: var(--green); flex: none; }
.photo-frame {
  border: 3px dashed #cdbf9f; border-radius: 18px; background: var(--surface-2);
  aspect-ratio: 1.58; display: grid; place-items: center; color: #a8987a; overflow: hidden; position: relative;
}
.photo-frame.face { aspect-ratio: 1; max-width: 300px; margin-inline: auto; border-radius: 50%; }
.photo-frame svg { width: 64px; height: 64px; }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-frame .overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.75); font-weight: 800; color: var(--ink); gap: 8px; align-content: center; }
.photo-state { display: flex; gap: 8px; align-items: center; justify-content: center; font-weight: 800; }
.photo-state svg { width: 26px; height: 26px; }
.photo-state.ok { color: var(--green); }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.review { display: grid; gap: 10px; }
.review-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.review-item b { display: block; font-size: .9rem; color: var(--muted); font-weight: 700; }
.review-item span.v { font-weight: 800; word-break: break-word; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.thumbs figure { margin: 0; text-align: center; font-size: .85rem; font-weight: 700; color: var(--muted); }
.thumbs .t { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; }
.thumbs .t img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .t svg { width: 30px; height: 30px; color: var(--terra); }

/* ---------- status / offers ---------- */
.status-card { text-align: center; padding: 30px 20px; }
.reason { background: var(--terra-soft); border-radius: 14px; padding: 14px; text-align: start; font-weight: 700; white-space: pre-line; color: #6a1f12; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 4px 12px; font-weight: 800; font-size: .9rem; }
.badge svg { width: 18px; height: 18px; }
.badge-ok { background: var(--green-soft); color: var(--green-dark); }
.badge-pending { background: var(--amber-soft); color: var(--amber); }
.badge-rejected { background: var(--terra-soft); color: var(--terra); }
.badge-draft { background: #eee; color: #555; }
.offer { padding: 0; overflow: hidden; }
.offer-body { padding: 18px; }
.offer h3 { font-size: 1.25rem; }
.offer .desc { white-space: pre-line; color: var(--muted); }
.reward { display: flex; align-items: center; gap: 8px; background: var(--brass-soft); color: #5b4100; font-weight: 900; padding: 10px 18px; border-bottom: 1px solid #efd9a1; }
.reward svg { width: 22px; height: 22px; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }

.setup-notice { text-align: center; }

footer.site { text-align: center; padding: 10px 16px 40px; color: var(--muted); font-size: .95rem; }
footer.site a { margin: 0 8px; }

/* ---------- privacy / static pages ---------- */
.prose h2 { margin-top: 1.2em; font-size: 1.25rem; color: var(--green-dark); }
.prose ul { padding-inline-start: 1.3em; margin: 0 0 .8em; }
.prose li { margin-bottom: .3em; }

/* ---------- dialog ---------- */
dialog { border: 0; border-radius: 20px; padding: 0; width: min(92vw, 460px); box-shadow: 0 20px 60px rgba(0,0,0,.3); color: var(--ink); }
dialog::backdrop { background: rgba(10, 20, 15, .55); }
.dlg { padding: 22px 18px; }
.dlg-actions { display: grid; gap: 10px; margin-top: 16px; }

.toast {
  position: fixed; inset: auto 16px calc(20px + env(safe-area-inset-bottom)) 16px; z-index: 50;
  max-width: 520px; margin: 0 auto; background: var(--ink); color: #fff; border-radius: 14px; padding: 14px 16px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
