:root {
  --navy: #061d3f;
  --navy-soft: #17345a;
  --gold: #b9954f;
  --gold-soft: #f3ead7;
  --ivory: #fbf8f1;
  --page: #f4efe6;
  --line: #e8dfcf;
  --text: #56657d;
  --success: #169b62;
  --danger: #c2363f;
  --radius: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
[dir="rtl"] body { font-family: "Geeza Pro", "Segoe UI", Tahoma, "Noto Naskh Arabic", Arial, sans-serif; }
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
a { color: var(--gold); }
h1, h2 { color: var(--navy); line-height: 1.25; margin: 0 0 12px; font-weight: 650; }
h1 { font-size: clamp(24px, 5vw, 32px); }
h2 { font-size: 22px; }

/* Header */
.top { background: var(--ivory); border-bottom: 3px solid var(--gold); }
.top-inner {
  max-width: 960px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
}
.logo { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; }
.brand { color: var(--navy); font-weight: 700; letter-spacing: .12em; font-size: 14px; }
.lang {
  margin-inline-start: auto; text-decoration: none; color: var(--navy);
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 6px 14px; font-size: 14px; font-weight: 600;
}
.lang:hover { border-color: var(--gold); }

.wrap { max-width: 960px; margin: 0 auto; padding: 20px 16px 32px; }

/* Intro */
.hero {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; margin-bottom: 18px;
}
.greeting { color: var(--navy); font-weight: 600; margin: 0 0 6px; }
.intro { margin: 0; }
.when {
  margin-top: 16px; padding: 12px 16px; background: var(--ivory); border: 1px solid var(--line);
  border-radius: 10px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline;
}
.when span { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.when strong { color: var(--navy); }

/* Progress */
.progress {
  list-style: none; margin: 0 0 18px; padding: 0;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
}
.progress li { text-align: center; font-size: 12px; color: #8f9bb0; }
.progress .dot {
  display: grid; place-items: center; margin: 0 auto 4px;
  width: 32px; height: 32px; border-radius: 50%;
  background: #fff; border: 2px solid var(--line); color: #8f9bb0; font-weight: 700; font-size: 14px;
}
.progress li.current .dot { border-color: var(--navy); background: var(--navy); color: #fff; }
.progress li.done .dot { border-color: var(--gold); background: var(--gold); color: #fff; }
.progress li.current .label { color: var(--navy); font-weight: 700; }
@media (max-width: 420px) { .progress .label { display: none; } }

/* Steps */
.step {
  border: 0; margin: 0; padding: 20px; min-width: 0;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
}
.step legend {
  float: left; width: 100%; padding: 0; margin-bottom: 16px;
  color: var(--navy); font-size: 20px; font-weight: 650;
}
[dir="rtl"] .step legend { float: right; }
.step legend + * { clear: both; }
.step-of {
  display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 2px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr 1fr; gap: 10px; } }

.card {
  position: relative; display: flex; flex-direction: column; cursor: pointer;
  border: 2px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card:hover { border-color: #d6c49b; }
.card input { position: absolute; opacity: 0; pointer-events: none; }
.card .photo { aspect-ratio: 4 / 3; background: var(--ivory); overflow: hidden; }
.card .photo img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.card .name { color: var(--navy); font-weight: 700; line-height: 1.3; }
.card .desc { font-size: 13px; line-height: 1.5; }
@media (max-width: 520px) { .card .desc { display: none; } .card .name { font-size: 14px; } }
.card .tick {
  position: absolute; top: 8px; inset-inline-end: 8px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--gold); color: #fff; font-weight: 700;
  opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s;
  box-shadow: 0 2px 8px rgba(6, 29, 63, .25);
}
.card:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.card input:checked ~ .tick { opacity: 1; transform: scale(1); }
.card input:focus-visible ~ .photo { outline: 3px solid var(--navy); outline-offset: -3px; }

.hint { margin: 14px 0 0; color: var(--danger); font-weight: 600; }

.actions {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px;
  position: sticky; bottom: 0; padding: 12px 0 calc(4px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, #fff 70%, rgba(255, 255, 255, 0));
}
.btn {
  appearance: none; border: 0; cursor: pointer; text-decoration: none; display: inline-block;
  background: var(--navy); color: #fff; font: inherit; font-weight: 650;
  padding: 13px 26px; border-radius: 10px; min-width: 120px; text-align: center;
}
.btn:hover { background: var(--navy-soft); }
.btn.gold { background: var(--gold); }
.btn.gold:hover { background: #a6843f; }
.btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.btn:disabled { opacity: .6; cursor: wait; }
@media (max-width: 520px) { .actions .btn { flex: 1; } }

/* Review and messages */
.review h2 { margin-bottom: 16px; }
.choices { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.choices li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--ivory); }
.choices li + li { border-top: 1px solid var(--line); }
.choices img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; }
.choices span { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.choices small { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.choices strong { color: var(--navy); }
.link { background: none; border: 0; color: var(--gold); font: inherit; font-weight: 700; cursor: pointer; padding: 6px; }
.note { margin: 16px 0 0; font-size: 14px; }

.message {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 24px; text-align: center;
}
.message p { margin: 0 auto 16px; max-width: 560px; }
.message .choices { text-align: start; max-width: 520px; margin: 20px auto; }
.badge {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center;
  background: #edf9f3; color: var(--success); font-size: 30px; font-weight: 700;
}
.badge.muted { background: var(--gold-soft); color: var(--gold); font-family: Georgia, serif; font-style: italic; }
.call a:not(.btn) { font-weight: 700; text-decoration: none; white-space: nowrap; }

.terms {
  margin-top: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 20px;
}
.terms summary { cursor: pointer; color: var(--navy); font-weight: 650; padding: 12px 0; }
.terms ul { margin: 0 0 16px; padding-inline-start: 20px; font-size: 14px; }

.foot { text-align: center; font-size: 13px; padding: 20px 16px 32px; background: var(--navy); color: #d9cdb3; }
.foot strong { letter-spacing: .1em; }
.foot a { color: #d9cdb3; text-decoration: none; }

.preview {
  margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; text-align: center;
  background: #fff4d6; border: 1px dashed var(--gold); color: #7a5c1e; font-size: 14px; font-weight: 600;
}
