/*
  register.css - styles for the early-access form on register.html (task S96-T11).
  Why: the shared styles.css has no form controls; keeping them here leaves styles.css (563 lines)
  under the 600-line limit and loads form styles only on the page that needs them.
  Connects to: register.html (classes .reg, .reg-*, .field*, .check, .hp), register.js (toggles
  [hidden], [aria-invalid], .is-error, .is-busy), and the brand tokens defined in styles.css
  (--surface, --ink, --stone, --border, --hanko, --ok, fonts). Reduced motion: the global
  prefers-reduced-motion rule in styles.css already turns off every transition used here.
  Input: prefers-color-scheme through the tokens. Output: form styling, 360 px and up.
*/

/* Layout: pitch and form side by side from 1000 px (grid from .mod-hero), aligned to the top. */
.reg .wrap { align-items: start; }
.reg-points { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; max-width: 54ch; }
.reg-points li { position: relative; padding-left: 22px; color: var(--stone); }
.reg-points li::before { content: ""; position: absolute; left: 2px; top: 0.6em; width: 8px; height: 8px; border-radius: 50%; background: var(--hanko); }

/* The card that holds the form and the success state. */
.reg-card { padding: 24px 20px; border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border), 0 40px 80px -48px rgba(0, 0, 0, 0.7); min-width: 0; }
@media (min-width: 640px) { .reg-card { padding: 32px; } }
.reg-form { display: grid; gap: 18px; }
.reg-note { font-size: 0.82rem; color: var(--stone); }

/* Fields: label above control, hint and error below. */
.field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field-row { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .field-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.field label, .field legend { font-size: 0.9rem; font-weight: 600; color: var(--ink); padding: 0; }
.req { color: var(--hanko); }
.opt { font-weight: 400; color: var(--stone); }
.field-hint { font-size: 0.8rem; color: var(--stone); }
.field-err { font-size: 0.82rem; color: var(--hanko); }

.reg-form input[type="text"], .reg-form input[type="email"], .reg-form input[type="tel"], .reg-form select, .reg-form textarea {
  width: 100%; min-width: 0; padding: 11px 14px; border: 0; border-radius: 10px;
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border); transition: box-shadow .2s;
}
.reg-form textarea { resize: vertical; min-height: 104px; }
.reg-form select { appearance: none; padding-right: 38px; background-image: linear-gradient(45deg, transparent 50%, var(--stone) 50%), linear-gradient(135deg, var(--stone) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.reg-form input:hover, .reg-form select:hover, .reg-form textarea:hover { box-shadow: inset 0 0 0 1px var(--stone); }
.reg-form input:focus-visible, .reg-form select:focus-visible, .reg-form textarea:focus-visible { outline: 2px solid var(--hanko); outline-offset: 2px; box-shadow: inset 0 0 0 1px var(--hanko); }
.reg-form [aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--hanko); }

/* Checkboxes: native controls, tinted with the brand colour, with a large hit area. */
.checks { display: grid; gap: 4px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 4px; }
@media (min-width: 560px) { .checks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; font-size: 0.92rem; font-weight: 400; color: var(--ink); cursor: pointer; overflow-wrap: anywhere; }
.field .check { font-weight: 400; }
.check input { flex-shrink: 0; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--hanko); cursor: pointer; }
.consent .check { font-size: 0.88rem; color: var(--stone); }
.modules legend { margin-bottom: 2px; }

/* Honeypot: off-screen and out of the accessibility tree (aria-hidden in the HTML). */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Submit row and status line. */
.reg-submit { display: grid; gap: 12px; justify-items: start; }
.reg-submit .button[disabled] { opacity: 0.6; cursor: progress; transform: none; box-shadow: none; }
.reg-status { min-height: 1.4em; font-size: 0.9rem; color: var(--stone); }
.reg-status.is-error { color: var(--hanko); }

/* Success state. */
.reg-success { display: grid; gap: 12px; justify-items: start; outline: none; }
.reg-success[hidden] { display: none; }
.reg-success h2 { font-family: var(--font-word); font-weight: 600; font-size: clamp(1.5rem, 3vw, 1.9rem); }
.reg-success p { color: var(--stone); }
.reg-tick { width: 48px; height: 48px; padding: 10px; border-radius: 50%; fill: none; stroke: var(--ok); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; background: rgba(var(--ok-rgb), 0.12); box-shadow: inset 0 0 0 1px rgba(var(--ok-rgb), 0.45); }
/* The tick draws itself only when motion is allowed; with reduced motion it is simply shown. */
@media (prefers-reduced-motion: no-preference) {
  .reg-success.is-shown .reg-tick path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: reg-draw .6s var(--ease) .1s forwards; }
}
@keyframes reg-draw { to { stroke-dashoffset: 0; } }
