/* ============================================================
   AD HOLIC — the brief
   A five-step modal that every CTA on the page opens. On phones it
   is a bottom sheet that leaves the page peeking above it; on
   larger screens a centred dialog.
   ============================================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(19, 7, 20, .8);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-2) var(--ease-out), visibility var(--dur-2);
}
.modal[data-open="true"] { opacity: 1; visibility: visible; }
@media (min-width: 768px) { .modal { align-items: center; padding: var(--s-6); } }

.sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 86svh;
  background: var(--void);
  border-radius: var(--r-3) var(--r-3) 0 0;
  box-shadow: var(--sh-3);
  overflow: hidden;
  transform: translateY(100%);
  transition: transform var(--dur-3) var(--ease-out);
}
.modal[data-open="true"] .sheet { transform: none; }
@media (min-width: 768px) {
  .sheet {
    max-width: 34rem;
    max-height: 90svh;
    border-radius: var(--r-3);
    transform: translateY(24px) scale(.97);
  }
  .modal[data-open="true"] .sheet { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet, .modal[data-open="true"] .sheet { transform: none; transition: none; }
}

/* Grab handle — the sheet affordance on phones. */
.sheet__grab {
  flex: none;
  width: 48px; height: 5px;
  margin: var(--s-3) auto 0;
  border-radius: var(--r-pill);
  background: var(--plum-high);
}
@media (min-width: 768px) { .sheet__grab { display: none; } }

.sheet__close {
  position: absolute;
  inset-inline-end: var(--s-3);
  top: var(--s-3);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(19,7,20,.8);
  color: var(--lilac);
  backdrop-filter: blur(6px);
  transition: background var(--dur-2), color var(--dur-2);
}
.sheet__close:hover { background: var(--plum); color: var(--ice); }
.sheet__close svg { width: 20px; height: 20px; }

.sheet__head { flex: none; padding: var(--s-6) var(--s-7) 0; }
.sheet__title { font-family: var(--font-display); font-size: var(--fs-2xl); }
.sheet__sub { margin-top: var(--s-2); font-size: var(--fs-sm); color: var(--lilac); }

/* Progress: one segment per step, filled as you advance. */
.steps { display: flex; gap: 5px; margin-top: var(--s-5); }
.steps i {
  flex: 1;
  height: 3px;
  border-radius: var(--r-pill);
  background: var(--plum-high);
  transition: background var(--dur-3) var(--ease-out);
}
.steps i[data-on="true"] { background: var(--ribbon); }

.sheet__body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: var(--s-6) var(--s-7); }

/* <fieldset> groups each step for assistive tech, but it arrives with a
   browser border, margin and padding that would draw a box around every
   question. Strip all three. */
.step {
  display: none;
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;   /* fieldset defaults to min-content and won't shrink */
}
.step[data-active="true"] { display: block; animation: step-in var(--dur-3) var(--ease-out); }
@keyframes step-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .step[data-active="true"] { animation: none; }
}

.step__n {
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: var(--tr-eyebrow);
  text-transform: uppercase;
  color: var(--magenta-soft);
}
:root[data-lang="ar"] .step__n { text-transform: none; letter-spacing: 0; }
.step__q { margin-top: var(--s-3); font-family: var(--font-display); font-size: var(--fs-xl); }
.step__hint { margin-top: var(--s-2); font-size: var(--fs-sm); color: var(--lilac); }

/* ---------- Options ---------- */

.opts { display: flex; flex-direction: column; gap: var(--s-3); margin-top: var(--s-5); }
.opt {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  min-height: 56px;
  padding: var(--s-3) var(--s-5);
  border: 1px solid var(--plum-high);
  border-radius: var(--r-2);
  background: transparent;
  text-align: start;
  font-size: var(--fs-sm);
  color: var(--ice);
  transition: border-color var(--dur-2), background var(--dur-2);
}
.opt:hover { border-color: var(--lilac); background: var(--plum); }
.opt__tick {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  border: 1px solid var(--plum-high);
  border-radius: 50%;
  transition: border-color var(--dur-2), background var(--dur-2);
}
.opt__tick svg { width: 12px; height: 12px; opacity: 0; transition: opacity var(--dur-1); }
.opt[aria-pressed="true"] { border-color: transparent; background: var(--plum); box-shadow: inset 0 0 0 1px var(--magenta); }
.opt[aria-pressed="true"] .opt__tick { background: var(--ribbon); border-color: transparent; }
.opt[aria-pressed="true"] .opt__tick svg { opacity: 1; }

/* ---------- Fields ---------- */

.fields { display: flex; flex-direction: column; gap: var(--s-5); margin-top: var(--s-5); }
.field { display: flex; flex-direction: column; gap: var(--s-2); }
.field__l { font-size: var(--fs-xs); font-weight: 700; color: var(--lilac); }
.field__opt { font-weight: 400; color: var(--lilac-dim); }
.field input,
.field textarea {
  width: 100%;
  min-height: 50px;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--plum-high);
  border-radius: var(--r-2);
  background: var(--plum);
  color: var(--ice);
  font: inherit;
  font-size: var(--fs-sm);
  transition: border-color var(--dur-2);
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.field input::placeholder,
.field textarea::placeholder { color: var(--lilac-dim); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--magenta); }
/* Phone numbers stay LTR even in Arabic — a leading "+" would
   otherwise jump to the wrong end of the field. */
.field input[type="tel"], .field input[type="email"] { direction: ltr; text-align: start; }
:root[dir="rtl"] .field input[type="tel"],
:root[dir="rtl"] .field input[type="email"] { text-align: right; }

/* The honeypot. Off-screen rather than display:none — some bots skip
   hidden inputs, and none of them skip one they cannot see. */
.hp {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.err {
  margin-top: var(--s-4);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-1);
  background: rgba(233, 29, 127, .12);
  border: 1px solid rgba(233, 29, 127, .4);
  font-size: var(--fs-sm);
  color: var(--magenta-soft);
}
/* The way out of a failed send. It has to read as a control, not as
   part of the apology, so it lifts to full-strength text. */
.err__wa {
  display: inline-block;
  margin-top: 4px;
  color: var(--ice);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.err__wa:hover { color: var(--magenta-soft); }

/* ---------- Footer bar ---------- */

.sheet__foot {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-5) var(--s-7) var(--s-6);
  border-top: 1px solid var(--plum-high);
  background: var(--void);
}
.sheet__foot .btn { flex: 1; }
.sheet__foot .btn--back { flex: none; min-width: 96px; }

/* ---------- Success ---------- */

.done { display: none; padding: var(--s-8) var(--s-7); text-align: center; }
.sheet[data-done="true"] .done { display: block; }
.sheet[data-done="true"] .sheet__body,
.sheet[data-done="true"] .sheet__foot,
.sheet[data-done="true"] .steps { display: none; }

.done__ring {
  display: grid;
  place-items: center;
  width: 76px; height: 76px;
  margin: 0 auto var(--s-6);
  border-radius: 50%;
  background: var(--ribbon);
  color: var(--ice);
}
.done__ring svg { width: 34px; height: 34px; }
.done__title { font-family: var(--font-display); font-size: var(--fs-2xl); }
.done__body { margin-top: var(--s-4); color: var(--lilac); }
.done__ref {
  display: inline-block;
  margin-top: var(--s-5);
  padding: var(--s-2) var(--s-5);
  border: 1px solid var(--plum-high);
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  letter-spacing: .1em;
  color: var(--lilac);
}
.done__cta { margin-top: var(--s-7); display: flex; flex-direction: column; gap: var(--s-3); }
