/* Matches Ornament's own auth form (account.ornament.health/auth): white page, one centred column, 70 px fields
 * with 16 px corners, code cells, a pill button in the brand red. Tokens taken from its CSS and the PRO ui-kit. */
:root {
  --bg: #ffffff; --ink: #000000; --muted: #909090; --disclaimer: #524d4c; --placeholder: #b2abaa;
  --line: #e9e9e9; --line-cell: #e2e2e2; --panel: #fafafa;
  --accent: #f40c44; --accent-hover: linear-gradient(84.59deg, #f40c44 15%, #ce45b3 85.1%);
  --disabled-bg: #e2e2e2; --disabled-ink: #909090;
  --error: #e83017; --ok: #09c84a; --focus: #253d7c;
  /* the system stack PRO uses; Suisse Intl (the site's font) is licensed per domain */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.5; }
.page { max-width: 512px; min-height: 100%; margin: 0 auto; padding: 20px; display: flex; flex-direction: column; }
.logo { display: flex; justify-content: center; padding: 4px 0 28px; }
.logo img { height: 30px; width: auto; }

.step { display: flex; flex-direction: column; gap: 20px; margin: auto 0; padding-bottom: 32px; }
h1 { font-size: 24px; line-height: 1.25; font-weight: 700; text-align: center; margin: 0; }
.lead { margin: -8px 0 0; text-align: center; overflow-wrap: anywhere; }
.lead-block { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: -8px; }
.lead-block .lead { margin: 0; }
.lead strong { font-weight: 700; }

.field { display: flex; flex-direction: column; gap: 8px; }
.label { font-size: 14px; line-height: 18px; color: var(--muted); padding-left: 4px; }
.optional { color: var(--muted); }
.field input, .field select, .field textarea {
  font: inherit; font-size: 18px; line-height: 1.4; color: var(--ink); background: var(--bg); width: 100%;
  border: 1px solid var(--line); border-radius: 16px; padding: 0 16px; height: 70px; appearance: none;
}
.field textarea { height: auto; min-height: 132px; padding: 16px; resize: vertical; }

/* reason: our own dropdown (a native select can neither wrap the chosen text nor be styled when open) */
.dropdown { position: relative; }
.dropdown-button {
  display: flex; align-items: center; width: 100%; min-height: 70px; padding: 12px 48px 12px 16px; text-align: left;
  font: inherit; font-size: 18px; line-height: 1.35; color: var(--ink); cursor: pointer;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%23909090' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 18px center;
}
.dropdown-button[aria-expanded="true"], .dropdown-button:focus { outline: none; border-color: var(--ink); }
.dropdown-button[aria-expanded="true"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 8l6-6 6 6' stroke='%23909090' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
.dropdown-value.placeholder { color: var(--placeholder); }
.dropdown.invalid .dropdown-button { border-color: var(--error); }
.dropdown-list {
  position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  background: var(--bg); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, .10);
  max-height: 60vh; overflow-y: auto;
}
.dropdown-list li {
  padding: 12px 40px 12px 12px; border-radius: 10px; font-size: 16px; line-height: 1.35; cursor: pointer; position: relative;
}
.dropdown-list li.active { background: var(--panel); }
.dropdown-list li[aria-selected="true"] { font-weight: 600; }
.dropdown-list li[aria-selected="true"]::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 14px; height: 10px; margin-top: -6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10' viewBox='0 0 14 10'%3E%3Cpath d='M1 5l4 4 8-8' stroke='%23F40C44' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat;
}
.field input::placeholder, .field textarea::placeholder { color: var(--placeholder); }
/* fields show focus with a black border (as account.ornament.health); buttons and links keep a ring */
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.primary:focus-visible, .link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.counter { align-self: flex-end; font-size: 13px; line-height: 16px; color: var(--muted); }

.cells { display: flex; gap: 12px; justify-content: center; align-items: center; }
.field .cells input {
  width: 51px; flex: 0 1 51px; min-width: 0; height: 56px; padding: 0; text-align: center; font-size: 32px; border-radius: 12px;
  border-color: var(--line-cell); caret-color: var(--accent);
}

/* an error is a quiet hint, not an alarm: a thin red border on the field and a small line under it */
.field input.invalid, .field select.invalid { border-color: var(--error); }
.field .cells.invalid input { border-color: var(--error); }
.field .cells input:focus { border-color: var(--ink); }

/* as wide as the 4 cells (4 × 51 + 3 × 12): a long error wraps under them instead of pushing them aside */
.code-box { align-self: center; width: 240px; max-width: 100%; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.code-box .field-error { padding-left: 0; }
.field-error { margin: 0; padding-left: 12px; font-size: 13px; line-height: 16px; color: var(--error); }
.form-error { margin: 0; text-align: center; font-size: 14px; line-height: 18px; color: var(--error); }
.info { margin: 0; background: var(--panel); border-radius: 8px; padding: 12px 16px; font-size: 14px; line-height: 18px; }

.link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; }
.link:disabled { color: var(--muted); cursor: default; }
.link.small { font-size: 13px; line-height: 16px; font-weight: 400; }

.disclaimer { margin: 0; text-align: center; font-size: 13px; line-height: 18px; letter-spacing: .52px; color: var(--disclaimer); }
.disclaimer a { color: var(--accent); text-decoration: none; }

.primary {
  position: relative; height: 56px; width: 100%; border: 0; border-radius: 9999px; cursor: pointer;
  background: var(--accent); color: #fff; font: inherit; font-size: 16px; font-weight: 700;
}
@media (hover: hover) { .primary:hover:not(:disabled) { background: var(--accent-hover); } }
.primary:disabled { background: var(--disabled-bg); color: var(--disabled-ink); cursor: default; }
.primary.loading { background: var(--accent); color: transparent; cursor: progress; }
.primary.loading::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px;
  border: 3px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .primary.loading::after { animation-duration: 2s; } }

.done { align-items: center; gap: 8px; text-align: center; }
.check { width: 56px; height: 56px; border-radius: 50%; background: var(--ok); display: grid; place-items: center; margin-bottom: 12px; }
.done .lead { margin: 0; }
.noscript { text-align: center; color: var(--muted); }
[hidden] { display: none !important; }

/* the code screen: checking (a short pause) and checked (locked, the request fields open below) */
.cells.checking input { opacity: .55; }
.field .cells.verified input { border-color: var(--ink); background: var(--panel); color: var(--ink); }
.step-follow { margin: 0 0 auto; }
#step-code:has(+ #step-request:not([hidden])) { margin-bottom: 0; padding-bottom: 8px; }
