/* Registration pages. Colours, type and spacing follow the design example.
   The layout uses logical properties (inline-start, inline-end) throughout,
   so the Arabic pages mirror themselves from dir="rtl" on <html>. */

@font-face { font-family: 'Rihal'; src: url('/fonts/rihal-300.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Rihal'; src: url('/fonts/rihal-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Rihal'; src: url('/fonts/rihal-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Rihal'; src: url('/fonts/rihal-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --bg: #0F051D;
  --surface: #181124;
  --surface-quiet: #150C23;
  --chip: #211832;
  --line: #2E2342;
  --line-strong: #3A2C52;
  --line-dashed: #4A3A66;
  --text: #FCFCFC;
  --text-soft: #D9CEEA;
  --muted: #A389D2;
  --faint: #7D6B9E;
  --accent: #ECFF77;
  --on-accent: #1A2000;
  --primary: #4500F9;
  --danger: #FF9D8A;
  --pad: 40px;
  --font: Rihal, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --read: 1.7; /* line height of running text */
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
}

h1, h2, h3, p, ol { margin: 0; }
ol { padding: 0; list-style: none; }
a { color: var(--accent); }
a:hover { color: #FFFFFF; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.accent { color: var(--accent); }

/* ── header ── */

.site-header {
  border-bottom: 1px solid var(--line);
  padding: 20px var(--pad);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  justify-content: space-between;
}
.site-header img { display: block; width: 94px; height: 48px; }
.site-header__side { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.step { font-size: 13px; color: var(--muted); }
.lang-switch {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
}
.lang-switch:hover { border-color: var(--accent); color: var(--accent); }

/* ── page frame ── */

.wrap {
  max-width: 940px;
  margin: 0 auto;
  padding: 52px var(--pad) 64px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}
.wrap--form { max-width: 780px; gap: 32px; }
.wrap--thanks { max-width: 760px; padding-top: 56px; gap: 28px; }

.block { display: flex; flex-direction: column; gap: 18px; }
.block__head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: baseline; justify-content: space-between; }
h2 { font-size: 24px; font-weight: 700; line-height: 1.25; }
h3 { font-size: 17px; font-weight: 500; line-height: 1.35; }
.note { font-size: 14px; color: var(--muted); }
.note--lead { font-size: 15px; line-height: 1.6; margin-top: 7px; }
.prose { display: flex; flex-direction: column; gap: 14px; font-size: 17px; line-height: var(--read); color: var(--text-soft); }

/* ── page 1 · hero ── */

.hero { display: flex; flex-direction: column; gap: 16px; }
.eyebrow { font-size: 14px; color: var(--muted); }
.display { font-size: clamp(38px, 8vw, 56px); font-weight: 700; line-height: 1.08; letter-spacing: -0.015em; }
.display-other { font-size: clamp(19px, 4vw, 23px); font-weight: 400; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.chip {
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
}
.invited-for { font-size: 14px; color: var(--text-soft); }
.hero__action { margin-top: 10px; }

.placeholder {
  border: 1px dashed var(--line-dashed);
  border-radius: 12px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 17px;
  line-height: var(--read);
  color: var(--muted);
}
.placeholder__tag { font-size: 11px; line-height: 1.4; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }

/* ── page 1 · why attend ── */

.why { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.why__item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--accent);
  border-radius: 14px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.why__item p { font-size: 15px; line-height: 1.65; color: var(--muted); }

/* ── page 1 · what participants gain ── */

.gain { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.gain th, .gain td { padding: 16px 22px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
.gain tbody tr:last-child th, .gain tbody tr:last-child td { border-bottom: 0; }
.gain thead th { background: var(--surface-quiet); font-size: 13px; font-weight: 500; color: var(--muted); }
.gain tbody th { width: 38%; background: var(--surface); font-size: 16px; font-weight: 500; color: var(--text); }
.gain tbody td { background: var(--surface); font-size: 15px; line-height: 1.6; color: var(--text-soft); }

.callout {
  background: var(--primary);
  border-radius: 14px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.callout h3 { color: #FFFFFF; font-weight: 700; }
.callout p { font-size: 15px; line-height: 1.65; color: #E4DAFB; }

/* ── page 1 · agenda ── */

.part { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.part__title { color: var(--accent); }
.agenda { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.agenda__row {
  display: flex;
  gap: 18px;
  padding: 17px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.agenda__row:last-child { border-bottom: 0; }
.agenda__row:nth-child(even) { background: var(--surface-quiet); }
.agenda__num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--chip);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}
.agenda__what { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
/* The morning, hour by hour: a time in place of the number; quiet rows for arrival, breaks and lunch. */
.agenda--times .agenda__row { flex-wrap: wrap; gap: 6px 20px; background: var(--surface); }
.agenda--times .agenda__row--quiet { background: var(--surface-quiet); }
.agenda__time { width: 128px; flex-shrink: 0; font-size: 14px; font-weight: 500; color: var(--accent); }
.agenda__row--quiet .agenda__time { color: var(--muted); }
.agenda--times .agenda__what { flex: 1 1 420px; }
.agenda__title { font-size: 16px; font-weight: 500; }
.agenda__detail { font-size: 14px; line-height: 1.6; color: var(--muted); }

/* ── page 1 · day picker ── */

.pick { display: flex; flex-direction: column; gap: 42px; scroll-margin-top: 24px; }
.days { display: flex; flex-wrap: wrap; gap: 14px; }
.day {
  position: relative;
  flex: 1 1 150px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 20px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
}
.day input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.day:hover { border-color: var(--muted); }
.day:has(input:checked), .day.is-picked { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.day:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.day--off { border-color: var(--line); opacity: 0.45; cursor: not-allowed; }
.day--off:hover { border-color: var(--line); }
.day--off input { cursor: not-allowed; }
.day__dow { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.day__num { font-size: 32px; font-weight: 700; line-height: 1; }
.day__month { font-size: 13px; color: var(--muted); }
.badge {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--muted);
}
.badge--on { background: var(--accent); color: var(--on-accent); }

/* On a phone page 1 is many screens long. Once the button at the top has
   scrolled away, and until the day picker is reached, the same button stays
   pinned to the bottom of the screen. pick.js shows and hides it. */
.jump-bar { display: none; }

/* ── buttons and action rows ── */

.actions { border-top: 1px solid var(--line); display: flex; }
.actions--split { padding-top: 32px; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.actions--stack { padding-top: 28px; margin-top: 12px; flex-direction: column; gap: 18px; align-items: flex-start; }
.actions--foot { padding-top: 26px; flex-wrap: wrap; gap: 20px; align-items: center; }
.picked { font-size: 15px; color: var(--text-soft); max-width: 460px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 999px;
  padding: 16px 32px;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  background: var(--chip);
  color: var(--muted);
}
.dot { width: 9px; height: 9px; border-radius: 999px; flex-shrink: 0; background: var(--line-strong); }
.btn--on, .pick:has(input[name='day']:checked) .btn, .pick.is-ready .btn { background: var(--primary); color: #FFFFFF; }
.btn--on .dot, .pick:has(input[name='day']:checked) .dot, .pick.is-ready .dot { background: var(--accent); }
.btn--on:hover, .pick:has(input[name='day']:checked) .btn:hover { background: #5519FF; color: #FFFFFF; }
.btn--on { padding: 17px 32px; }

/* ── page 2 · form ── */

.intro { display: flex; flex-direction: column; gap: 12px; }
.intro h1 { font-size: clamp(28px, 6vw, 38px); font-weight: 700; line-height: 1.12; letter-spacing: -0.015em; }
.intro p { font-size: 16px; line-height: 1.65; color: var(--text-soft); }
.intro--big { gap: 14px; }
.intro--big h1 { font-size: clamp(30px, 6.6vw, 42px); line-height: 1.1; }
.intro--big p { font-size: 17px; }
.intro--big .eyebrow { font-size: 14px; color: var(--muted); }

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 8px 22px;
}
.summary__day { font-size: 16px; font-weight: 500; color: var(--accent); }
.summary__rest { font-size: 15px; color: var(--text-soft); }
.summary__change { margin-inline-start: auto; display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 500; }

.form { display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field-row { display: flex; flex-wrap: wrap; gap: 20px; }
.field-row .field:first-child { flex: 1 1 260px; }
.field-row .field:last-child { flex: 1 1 200px; }
label { font-size: 14px; font-weight: 500; color: var(--text-soft); }
.optional { color: var(--faint); font-weight: 400; }
input[type='text'], input[type='email'], input[type='tel'], input[type='password'] {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  padding: 15px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
}
input::placeholder { color: var(--faint); opacity: 1; }
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field--error input { border-color: var(--danger); }
.field__error { font-size: 13px; color: var(--danger); }
.alert {
  border: 1px solid var(--danger);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--danger);
}
.fineprint { font-size: 13px; line-height: 1.6; color: var(--muted); }
.cf-turnstile { min-height: 65px; }

/* A field people never see. Automated form-fillers fill it in and give
   themselves away. Clipped in place rather than moved off-screen, which would
   add a sideways scrollbar on right-to-left pages. */
.extra-field { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ── thank-you pages ── */

.mark { width: 58px; height: 58px; border-radius: 999px; display: flex; align-items: center; justify-content: center; }
.mark--done { background: var(--accent); color: var(--on-accent); }
.mark--wait { border: 2px solid var(--accent); color: var(--accent); }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card__label { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.card__day { font-size: 17px; font-weight: 500; color: var(--accent); }
.card__text { font-size: 15px; line-height: 1.6; color: var(--text-soft); }
.link-strong { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 500; }

/* ── Arabic ──
   Arabic letters come from the reader's system typeface (the same stack as
   everywhere else: any letter the brand face lacks falls through to it).
   Arabic needs more line height, and letter-spacing must be off: spacing
   breaks the joins between letters. */

html[lang='ar'] {
  --font: Rihal, system-ui, -apple-system, 'Segoe UI', 'Noto Sans Arabic', Tahoma, sans-serif;
  --read: 1.95;
}
html[lang='ar'] body { line-height: 1.6; }
html[lang='ar'] body * { letter-spacing: normal; }
html[lang='ar'] .display { line-height: 1.3; }
html[lang='ar'] .intro h1, html[lang='ar'] .intro--big h1 { line-height: 1.4; }
html[lang='ar'] h2 { line-height: 1.5; }
html[lang='ar'] .why__item p, html[lang='ar'] .callout p, html[lang='ar'] .gain tbody td,
html[lang='ar'] .agenda__detail, html[lang='ar'] .intro p, html[lang='ar'] .card__text, html[lang='ar'] .fineprint { line-height: 1.85; }
html[lang='ar'] .day__dow { font-size: 14px; }

/* ── small screens ── */

@media (max-width: 720px) {
  .why { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  :root { --pad: 20px; }

  /* Header: logo and language switch on one line, the step underneath. */
  body:not(.admin) .site-header { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 12px; padding-block: 12px; }
  body:not(.admin) .site-header__side { display: contents; }
  body:not(.admin) .site-header img { grid-column: 1; grid-row: 1; width: 78px; height: 40px; }
  body:not(.admin) .lang-switch { grid-column: 2; grid-row: 1; }
  body:not(.admin) .step { grid-column: 1 / -1; grid-row: 2; }

  .chips { gap: 8px; }
  .chip { padding: 8px 13px; font-size: 13px; }

  .jump-bar.is-shown {
    display: block;
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 10;
    padding: 12px var(--pad) calc(12px + env(safe-area-inset-bottom));
    background: rgba(15, 5, 29, 0.94);
    border-top: 1px solid var(--line);
  }
  .jump-bar .btn { width: 100%; justify-content: center; }

  .wrap { padding-top: 36px; padding-bottom: 48px; gap: 38px; }
  .pick { gap: 34px; }
  h2 { font-size: 21px; }
  .prose, .placeholder { font-size: 16px; }
  .agenda__row { padding: 15px 16px; gap: 14px; }
  .agenda__time { width: 100%; }
  /* The five days as a list of rows: easier to hit than a grid, and no odd one out. */
  .days { flex-direction: column; gap: 10px; }
  .day { flex: none; flex-direction: row; align-items: center; gap: 10px; min-height: 64px; padding: 12px 16px; }
  .day__dow { min-width: 38px; }
  html[lang='ar'] .day__dow { min-width: 62px; }
  .day__num { font-size: 24px; }
  .day__month { font-size: 14px; }
  .day .badge { margin-top: 0; margin-inline-start: auto; }
  .actions--split .btn, .actions--stack .btn, .hero__action .btn { width: 100%; justify-content: center; }
  .summary { padding: 14px 18px 4px; }
  .summary__change { margin-inline-start: 0; width: 100%; }
  /* The two-column table becomes a stack of pairs. */
  .gain thead { display: none; }
  .gain, .gain tbody, .gain tr, .gain th, .gain td { display: block; width: auto; }
  .gain tbody th { width: auto; padding: 16px 18px 4px; border-bottom: 0; }
  .gain tbody td { padding: 0 18px 16px; }
  .gain tbody tr:last-child th { border-bottom: 0; }
  .gain tbody tr:not(:last-child) td { border-bottom: 1px solid var(--line); }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .btn, .day, .lang-switch { transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease; }
}
