/* Layout: the page is the "Register Interest" sheet from the WhatsApp journey. A sticky top bar
   (close + title), a scrolling body, and a sticky footer holding the main button. On phones it
   fills the screen; on wider screens it sits as a 440px card on the teal brand ground.
   The page commits to one branded light look, so there is no dark variant. */
:root {
  --teal: #0f2a2e;
  --teal-3: #1d4a50;
  --sand: #e2d3bf;
  --sand-2: #f3ece2;
  --ivory: #fbf8f3;
  --ink: #111b21;
  --ink-2: #3d4c50;
  --text-2: #4a5a5e;
  --muted: #5f6c70;
  --faint: #687477;
  --placeholder: #6b787b;
  --line: #e6e0d6;
  --field: #d4ccbf;
  --dot: #8e877c;
  --err: #b3261e;
  --err-bg: #fbeceb;
  --focus: rgba(29, 74, 80, 0.16);

  --serif: "Marcellus", Georgia, "Times New Roman", serif;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--ivory); color: var(--ink); }
/* Keeps a focused field clear of the sticky bars when the page scrolls to it. */
html { scroll-padding-top: 64px; scroll-padding-bottom: 190px; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
h1, p { margin: 0; }
button { font: inherit; }

/* Sheet frame */
.sheet {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--ivory);
}
main { flex: 1; display: flex; flex-direction: column; }
.step { flex: 1; display: flex; flex-direction: column; }

/* Top bar */
.shead {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 10px;
  background: var(--ivory);
  border-bottom: 1px solid var(--line);
}
.close {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--teal);
}
.close:hover { background: rgba(15, 42, 46, 0.06); }
.close:focus-visible { outline: 3px solid var(--teal-3); outline-offset: 1px; }
.stitle {
  flex: 1;
  margin-right: 36px;
  text-align: center;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
}

/* Body */
.sbody { flex: 1; padding: 22px 20px 22px; }
.slogo { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.ologo { height: 64px; width: auto; flex: none; }
.slogo h1 {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slogo h1.wrap { white-space: normal; text-overflow: clip; }
/* Registration page: the Panchshil and Oleander logos side by side in the centre, a thin line between. */
.brands { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 2px 0 14px; }
/* Both logos the same height. */
.plogo { width: 72px; height: 72px; flex: none; }
.brand-rule { width: 1px; height: 72px; flex: none; background: var(--field); }
.brands .ologo { height: 72px; }
/* Read by screen readers, not shown. */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.005em;
  color: var(--teal);
  text-wrap: balance;
}
h1:focus { outline: none; }
.desc { font-size: 14.5px; line-height: 1.5; color: var(--text-2); margin: 8px 0 20px; }

/* Business WhatsApp number card */
.linked {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 20px;
  padding: 11px 13px;
  background: var(--sand-2);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.linked .ic {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e2d3bf' stroke-width='2'%3E%3Cpath d='M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1 1 .4 1.9.7 2.8a2 2 0 0 1-.5 2.1L8 9.9a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.5c.9.3 1.8.6 2.8.7a2 2 0 0 1 1.7 2z'/%3E%3C/svg%3E") no-repeat center / 15px;
}
.linked > div { min-width: 0; }
.linked b { display: block; font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.linked small { display: block; font-size: 12.5px; line-height: 1.4; color: var(--muted); }

/* Fields */
form, .questions { display: flex; flex-direction: column; gap: 16px; }
.questions:empty { min-height: 320px; }
.field { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.lbl {
  display: block;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.01em;
}
.lbl em { font-style: normal; font-weight: 500; color: var(--faint); }

input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="url"], input[type="date"], select {
  width: 100%;
  height: 48px;
  border: 1px solid var(--field);
  border-radius: 10px;
  padding: 0 14px;
  font: inherit;
  font-size: 16px; /* 16px stops iOS from zooming into the field */
  color: var(--ink);
  background-color: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}
input[type="date"] { line-height: 46px; }
textarea {
  width: 100%;
  min-height: 104px;
  border: 1px solid var(--field);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background-color: #fff;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea::placeholder { color: var(--placeholder); opacity: 1; }
textarea:focus { outline: 0; border-color: var(--teal-3); box-shadow: 0 0 0 3px var(--focus); }
.field.bad textarea { border-color: var(--err); }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
input::placeholder { color: var(--placeholder); opacity: 1; }
select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231d4a50' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
}
input:focus, select:focus { outline: 0; border-color: var(--teal-3); box-shadow: 0 0 0 3px var(--focus); }
.field.bad input, .field.bad select { border-color: var(--err); }

.ferr {
  display: flex;
  gap: 5px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--err);
}
.ferr::before {
  content: "";
  flex: none;
  width: 13px;
  height: 13px;
  margin-top: 2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b3261e' stroke-width='2.4'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 7v6M12 16.5v.5'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* Radio choices */
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--field);
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.choice:hover { border-color: var(--teal-3); }
.choice.sel { border-color: var(--teal); background: #f1f5f4; }
.choice input, .consent input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}
.dot {
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  border: 1.6px solid var(--dot);
  display: grid;
  place-items: center;
}
.choice.sel .dot { border-color: var(--teal); }
.choice.sel .dot::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--teal); }
.choice input:focus-visible + .dot,
.choice input:focus-visible + .box,
.consent input:focus-visible + .box { outline: 2px solid var(--teal-3); outline-offset: 2px; }
.field.bad .choice { border-color: var(--err); }

/* Consent */
.consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-2);
  cursor: pointer;
}
.box {
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 1px;
  border-radius: 5px;
  border: 1.6px solid var(--dot);
  background: #fff;
  transition: background-color 0.15s, border-color 0.15s;
}
.consent input:checked + .box,
.choice input:checked + .box {
  background: var(--teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e2d3bf' stroke-width='3.2'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") no-repeat center / 12px;
  border-color: var(--teal);
}
.field.bad .box { border-color: var(--err); }

/* Honeypot: off-screen, never shown to people */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.note {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  background: var(--sand-2);
  border-radius: 10px;
  padding: 10px 12px;
}
.form-error {
  font-size: 13.5px;
  color: var(--err);
  background: var(--err-bg);
  border-radius: 10px;
  padding: 10px 12px;
}
.nojs { margin: 20px; }

/* Sticky footer */
.sfoot {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--ivory);
  border-top: 1px solid var(--line);
}
.sfoot small { display: block; text-align: center; color: var(--faint); font-size: 11.5px; }

/* Buttons */
.primary, .secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, transform 0.1s;
}
.primary { border: 0; background: var(--teal); color: var(--sand); }
.primary:hover { background: var(--teal-3); }
.secondary { border: 1.5px solid var(--teal); background: transparent; color: var(--teal); }
.secondary:hover { background: #eef2f1; }
.primary:active, .secondary:active { transform: scale(0.99); }
.primary:disabled, .secondary:disabled { opacity: 0.6; cursor: progress; transform: none; }
.primary:focus-visible, .secondary:focus-visible, .linkbtn:focus-visible {
  outline: 3px solid var(--teal-3);
  outline-offset: 2px;
}
.linkbtn {
  align-self: flex-start;
  border: 0;
  background: none;
  padding: 4px 0;
  color: var(--teal-3);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.linkbtn.center { align-self: center; display: block; margin: 12px auto 0; }
.actions { display: flex; flex-direction: column; gap: 9px; }

/* Thank-you and done screens */
.mark {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  margin: 6px 0 18px;
  background: var(--teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e2d3bf' stroke-width='2.4'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") no-repeat center / 24px;
}
[data-step="thanks"] h1, [data-step="done"] h1 { font-size: 26px; }
.lead { font-size: 16px; color: var(--ink); margin-top: 10px; }
.body { font-size: 14.5px; color: var(--text-2); margin-top: 10px; }
.ask { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-top: 24px; }
.summary {
  margin: 18px 0 0;
  padding: 2px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.summary div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  font-size: 14px;
}
.summary div + div { border-top: 1px solid var(--line); }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; text-align: right; font-weight: 600; }
[data-step="done"] .body { margin-top: 16px; }
[data-step="done"] .form-error { margin-top: 14px; }
[data-step="done"] .actions { margin-top: 18px; }

/* Wider screens: the sheet becomes a card on the brand teal */
@media (min-width: 560px) {
  html, body { background: var(--teal); }
  body { padding-block: 32px; padding-inline: 16px; }
  .sheet {
    min-height: 0;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  }
  .shead { border-radius: 20px 20px 0 0; padding-top: 10px; top: 0; }
  .sfoot { border-radius: 0 0 20px 20px; padding-bottom: 18px; }
}

/* When the on-screen keyboard shrinks the page, let the bars scroll away so they never cover a field. */
@media (max-height: 480px) {
  .shead, .sfoot { position: static; }
  html { scroll-padding-top: 0; scroll-padding-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
