/* Registration (specs/registration-redesign/ux-plan.md). Loaded by homepage_v2/register.php AFTER landing/lp.css (brand tokens,
   .lp-btn, .lp-scope resets) and admin/v2/_th2-select.css (the styled select). Mobile first (390px), logical properties only.
   Hex values live in the token block only. Motion only under prefers-reduced-motion: no-preference. */

.reg {
  /* brand pack 2026-12 (lp.css tokens) */
  --reg-canvas: linear-gradient(180deg, var(--lp-mint) 0%, #fff 520px), #fff;
  --reg-line: #8a93a6;           /* input edge, 3.2:1 on white (WCAG 1.4.11) */
  --reg-err-bg: #fff6f5;
  --reg-alert-bg: #fff0ef;
  --reg-track: #dfe4ee;
  --reg-ease: cubic-bezier(.2, .8, .2, 1);
  /* th2 tokens the styled select reads, mapped onto the brand (the admin kit's token set is not on the public site) */
  --th2-font: inherit;
  --th2-ink: var(--lp-ink); --th2-ink-2: var(--lp-ink2); --th2-muted: var(--lp-mute); --th2-muted-2: var(--lp-mute);
  --th2-surface: #fff; --th2-surface-2: var(--lp-soft);
  --th2-border-control: var(--reg-line); --th2-border-strong: var(--reg-line);
  --th2-focus: var(--lp-focus); --th2-danger: var(--lp-red); --th2-success: var(--lp-green);
  --th2-info: var(--lp-hat); --th2-warning: var(--lp-amber-ink);
  --th2-text-base: 16px; --th2-text-md: 16px; --th2-text-lg: 17px;
  --th2-r-sm: 8px; --th2-r: 12px; --th2-r-lg: 16px;
  --th2-shadow-xs: 0 1px 2px rgba(20, 22, 31, .06);
  --th2-shadow-lg: var(--lp-shadow);
  --th2-ease-out: var(--reg-ease);

  font-family: 'Heebo', 'Heebo Fallback', -apple-system, 'Segoe UI', Arial, sans-serif;
  font-size: 17px; line-height: 1.55; color: var(--lp-ink);
  background: var(--reg-canvas);
  padding-block: 20px 40px;
  overflow-x: clip;   /* the tilted seal's starburst never widens the page */
}
.reg-wrap { max-inline-size: 560px; margin-inline: auto; padding-inline: 12px; }

/* card */
.reg-card { position: relative; background: #fff; border-radius: 22px; padding: 22px 18px 18px; box-shadow: var(--lp-shadow); }
.reg-head { display: grid; gap: 10px; }
.reg-title { font-size: clamp(1.6rem, 6.4vw, 2rem); font-weight: 800; line-height: 1.15; letter-spacing: -.01em; text-wrap: balance; }
.reg-lead { font-size: 17px; color: var(--lp-ink2); }
.reg-trial { display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 6px 12px; border-radius: 999px; background: var(--lp-green-bg); color: var(--lp-green); font-weight: 700; font-size: 16px; }
.reg-trial .th-icon { inline-size: 18px; block-size: 18px; }

/* promo: the campaign seal as a sticker on the card's top corner (lp-promo.css draws it); the offer strip reuses .lp-offer */
.reg--promo .reg-card { margin-block-start: 34px; }
.reg .reg-card > .lp-seal { --seal: 104px; position: absolute; float: none; margin: 0; inset-block-start: -40px; inset-inline-end: 4px; inset-inline-start: auto; }
.reg--promo .reg-title { padding-inline-end: 96px; }
.reg .reg-offer { margin-block-start: 4px; max-inline-size: none; padding: 12px 14px 10px; }
.reg .reg-offer .lp-offer-w { margin: 0; font-size: 18px; font-weight: 800; }
.reg .reg-offer .lp-offer-c { margin-block-start: 8px; padding-block-start: 6px; font-size: 15.5px; }

/* progress */
.reg-progress { margin-block-start: 18px; }
.reg-progress-t { font-size: 15px; font-weight: 700; color: var(--lp-ink2); }
.reg-progress-t:empty { display: none; }
.reg-bar { display: flex; gap: 6px; margin-block-start: 8px; }
.reg-bar li { flex: 1; block-size: 6px; border-radius: 999px; background: var(--reg-track); overflow: hidden; position: relative; }
.reg-bar li::after { content: ""; position: absolute; inset: 0; background: var(--lp-hat); transform: scaleX(0); transform-origin: right; }
.reg-bar li.is-done::after, .reg-bar li.is-now::after { transform: scaleX(1); }
.reg-bar li.is-now::after { background: var(--lp-yellow); }
.reg:not(.reg--js) .reg-progress { display: none; }

/* form-level alert */
.reg-alert { margin-block-start: 14px; display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--reg-alert-bg); color: var(--lp-red); font-size: 16px; font-weight: 600; line-height: 1.45; }
.reg-alert[hidden] { display: none; }
.reg-alert:focus { outline: none; }
.reg-alert .th-icon { flex: none; inline-size: 20px; block-size: 20px; margin-block-start: 1px; }
.reg-alert a { color: inherit; font-weight: 800; white-space: nowrap; }

/* steps */
.reg-form { margin: 0; }
.reg-step { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
.reg-step + .reg-step { margin-block-start: 26px; }
.reg--js .reg-step + .reg-step { margin-block-start: 0; }
.reg-step[hidden] { display: none; }
.reg-step-h { margin-block-start: 16px; font-size: 20px; font-weight: 800; }
.reg-step-h:focus { outline: none; }
.reg-row { display: grid; gap: 0 12px; align-items: start; }

/* fields */
.reg-field { margin-block-start: 16px; }
.reg-label { display: block; font-weight: 700; font-size: 17px; margin-block-end: 6px; }
.reg-req { color: var(--lp-red); margin-inline-start: 2px; }
.reg-hint { margin-block: -2px 6px; font-size: 15px; color: var(--lp-mute); line-height: 1.4; }
.reg-input { display: block; inline-size: 100%; min-block-size: 52px; padding: 0 14px; font: inherit; font-size: 17px; color: var(--lp-ink); background: #fff; border: 2px solid var(--reg-line); border-radius: 12px; appearance: none; -webkit-appearance: none; }
.reg-input[dir="ltr"] { text-align: end; }      /* digits and addresses read LTR but sit on the RTL edge like the label */
.reg-input[readonly] { background: var(--lp-soft); color: var(--lp-ink2); }
.reg-input:focus-visible { outline: 3px solid var(--lp-focus); outline-offset: 1px; box-shadow: none; border-color: var(--lp-focus); }
.reg-input[aria-invalid="true"] { border-color: var(--lp-red); background: var(--reg-err-bg); }
.reg-input.is-ok { border-color: var(--lp-green); }
.reg-err { display: flex; align-items: flex-start; gap: 6px; margin-block-start: 6px; color: var(--lp-red); font-size: 15.5px; font-weight: 600; line-height: 1.4; }
.reg-err[hidden] { display: none; }
.reg-err .th-icon { flex: none; inline-size: 18px; block-size: 18px; margin-block-start: 2px; }
.reg .th2-select { font-size: 17px; }
.reg .th2-select__trigger { font-weight: 500; }

/* password: show/hide key inside the field + strength hint */
.reg-pw { position: relative; }
/* The value reads LTR from the label side (right); the key sits on the far side (left). The input is dir=ltr, so its
   padding-inline-start is the left edge; the key is placed in the RTL wrapper, so its inset-inline-end is the left edge. */
.reg-pw .reg-input { padding-inline-start: 98px; }
.reg-pw-key { position: absolute; inset-block: 6px; inset-inline-end: 6px; display: inline-flex; align-items: center; gap: 6px; min-inline-size: 80px; padding-inline: 10px; border: 0; border-radius: 9px; background: var(--lp-soft); color: var(--lp-hat); font-weight: 700; font-size: 16px; cursor: pointer; }
.reg-pw-key .th-icon { inline-size: 18px; block-size: 18px; }
.reg-pw-key:focus-visible { outline: 3px solid var(--lp-focus); outline-offset: 1px; }
.reg-meter { display: flex; gap: 4px; margin-block-start: 8px; inline-size: 132px; }
.reg-meter i { flex: 1; block-size: 5px; border-radius: 999px; background: var(--reg-track); }
.reg-meter[data-level="1"] i:nth-child(1) { background: var(--lp-red); }
.reg-meter[data-level="2"] i:nth-child(-n+2) { background: var(--lp-amber-ink); }
.reg-meter[data-level="3"] i { background: var(--lp-green); }
.reg-meter-t { margin-block-start: 4px; font-size: 15px; color: var(--lp-ink2); }
.reg-meter-t:empty { display: none; }
.reg-meter[data-level="0"] { display: none; }

/* consents: real 26px boxes in 48px rows */
.reg-consents { margin-block-start: 8px; }
.reg-check { display: flex; align-items: flex-start; gap: 12px; min-block-size: 48px; padding-block: 10px 0; font-size: 16px; line-height: 1.5; cursor: pointer; }
.reg-check input { flex: none; inline-size: 26px; block-size: 26px; margin: 0; margin-block-start: 1px; accent-color: var(--lp-hat); cursor: pointer; }
.reg-check a { color: var(--lp-hat); font-weight: 700; text-underline-offset: 3px; }
.reg-check--opt { color: var(--lp-ink2); }
.reg-consents .reg-field { margin-block-start: 0; }
.reg-check:has(input[aria-invalid="true"]) input { outline: 2px solid var(--lp-red); outline-offset: 2px; }

/* turnstile: a quiet framed slot */
.reg-ts { margin-block-start: 16px; padding: 12px; border: 1.5px dashed var(--reg-track); border-radius: 14px; background: var(--lp-soft); }
.reg-ts-l { display: flex; align-items: center; gap: 6px; margin-block-end: 8px; font-size: 15px; font-weight: 700; color: var(--lp-ink2); }
.reg-ts-l .th-icon { inline-size: 18px; block-size: 18px; color: var(--lp-hat); }
.reg-ts-w { min-block-size: 65px; display: flex; justify-content: center; }
.reg-ts-w > * { max-inline-size: 100%; }

/* actions: back (outline) + the one gold key */
.reg-actions { display: flex; gap: 10px; margin-block-start: 22px; }
.reg-actions .lp-btn { min-block-size: 56px; }
.reg-back { --lp-fg: var(--lp-ink2); flex: none; padding-inline: 14px; font-size: 17px; }
.reg-back[hidden] { display: none; }
.reg-back .th-icon { inline-size: 18px; block-size: 18px; }
.reg-next { flex: 1; white-space: nowrap; }
.reg-next-ic { inline-size: 18px; block-size: 18px; }
.reg-next.is-last .reg-next-ic { display: none; }
.reg-spin { display: none; inline-size: 20px; block-size: 20px; border: 3px solid rgba(26, 26, 26, .25); border-block-start-color: var(--lp-yellow-ink); border-radius: 50%; }
.reg-next.is-busy .reg-spin { display: inline-block; }
.reg-next.is-busy .reg-next-ic { display: none; }
.reg-next.is-busy { opacity: .9; pointer-events: none; }

.reg-notice { margin-block: 12px 0; font-size: 15px; color: var(--lp-mute); line-height: 1.5; text-align: center; }
.reg-notice a { color: var(--lp-ink2); text-decoration: underline; }
.reg-login { margin-block-start: 16px; text-align: center; font-size: 16px; color: var(--lp-ink2); }
.reg-login a { display: inline-flex; align-items: center; min-block-size: 44px; color: var(--lp-hat); font-weight: 800; text-underline-offset: 3px; }

/* success */
.reg-done { display: grid; justify-items: center; gap: 12px; padding-block: 18px 6px; text-align: center; }
.reg-done[hidden] { display: none; }
.reg-tick { inline-size: 76px; block-size: 76px; }
.reg-tick circle { fill: var(--lp-green-bg); }
.reg-tick path { fill: none; stroke: var(--lp-green); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.reg-done-h { font-size: 26px; font-weight: 800; }
.reg-done-h:focus { outline: none; }
.reg-done-p { font-size: 17px; color: var(--lp-ink2); max-inline-size: 36ch; }
.reg-done-mail { display: block; margin-block: 2px 4px; font-weight: 700; color: var(--lp-ink); overflow-wrap: anywhere; }
.reg-done .lp-btn { margin-block-start: 6px; }
.reg-done-s { font-size: 15px; color: var(--lp-mute); }

/* wider screens: pairs side by side, roomier card */
@media (min-width: 600px) {
  .reg { padding-block: 40px 64px; }
  .reg-card { padding: 30px 32px 24px; }
  .reg-row { grid-template-columns: 1fr 1fr; }
  .reg .reg-card > .lp-seal { --seal: 128px; inset-block-start: -52px; inset-inline-end: -40px; }
  .reg--promo .reg-title { padding-inline-end: 84px; }
}

@media (prefers-reduced-motion: no-preference) {
  .reg-bar li::after { transition: transform .3s var(--reg-ease); }
  .reg-input, .reg-pw-key { transition: border-color .1s ease, background-color .1s ease; }
  .reg-step.is-in-fwd { animation: reg-in-fwd .22s var(--reg-ease) both; }
  .reg-step.is-in-back { animation: reg-in-back .22s var(--reg-ease) both; }
  .reg-done:not([hidden]) { animation: reg-fade .2s ease-out both; }
  .reg-done:not([hidden]) .reg-tick circle { animation: reg-pop .32s cubic-bezier(.2, 1.4, .4, 1) both; transform-origin: center; transform-box: fill-box; }
  .reg-done:not([hidden]) .reg-tick path { animation: reg-draw .4s ease-out .15s both; }
  .reg-next.is-busy .reg-spin { animation: reg-spin .7s linear infinite; }
  .reg-err:not([hidden]) { animation: reg-fade .15s ease-out both; }
}
@media (prefers-reduced-motion: reduce) {
  .reg-next.is-busy .reg-spin { border-block-start-color: rgba(26, 26, 26, .25); }
}
/* RTL: forward = the next step comes in from the inline-end side (the left) */
@keyframes reg-in-fwd { from { opacity: 0; transform: translateX(-18px); } }
@keyframes reg-in-back { from { opacity: 0; transform: translateX(18px); } }
@keyframes reg-fade { from { opacity: 0; } }
@keyframes reg-pop { from { transform: scale(.6); opacity: 0; } }
@keyframes reg-draw { from { stroke-dashoffset: 1; } }
@keyframes reg-spin { to { transform: rotate(360deg); } }
