/* Page 2 · Sign up / Log in (magic link). Mobile-first: one card on phones, card + info panel on desktop. */

.auth { padding: 16px 0 32px; }
.auth-grid { display: grid; gap: 24px; }
.auth-card { padding: 24px 20px; }
.auth-card h1 { font-size: 1.6rem; }
.auth-card .lead { margin-top: 8px; color: var(--ink-2); }
[data-state] > .btn { margin-top: 10px; }
.btn[disabled] { opacity: 0.55; cursor: default; transform: none; }

/* Form */
#login-form { margin-top: 20px; display: grid; gap: 8px; }
.field-label { font-weight: 700; font-size: 0.92rem; padding: 0; }
.field-hint { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.input {
  width: 100%; min-height: 52px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px;
  background: var(--paper); font-size: 1rem; /* 16px+ stops iOS zooming into the field */
}
.input:focus { outline: none; border-color: var(--ink); background: #fff; }
.input[aria-invalid="true"] { border-color: var(--bad); background: #fff; }
.field-error { color: var(--bad); font-size: 0.88rem; font-weight: 600; }
.field-error::before { content: "! "; font-weight: 800; }

.roles { border: 0; padding: 0; margin: 12px 0 10px; min-width: 0; }
.role-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.role { position: relative; }
.role input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.role-box {
  display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 76px; padding: 10px 4px;
  border: 2px solid var(--line); border-radius: 12px; background: var(--card);
  font-weight: 700; font-size: 0.88rem; text-align: center; color: var(--ink-2);
}
.role-box svg { width: 24px; height: 24px; }
/* Selected: thicker dark border + tinted fill + check mark, so it never relies on colour alone */
.role input:checked + .role-box { border-color: var(--ink); background: var(--paper-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.role input:checked + .role-box::after {
  content: "✓"; position: absolute; top: 6px; right: 8px; font-size: 0.8rem; font-weight: 800; color: var(--ink);
}
.role input:focus-visible + .role-box { outline: 3px solid var(--accent); outline-offset: 2px; }

.legal { margin-top: 14px; font-size: 0.82rem; color: var(--muted); }
.legal a { color: var(--ink-2); }
.divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 12px; color: var(--muted); font-size: 0.85rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.guest-note { margin-top: 8px; font-size: 0.82rem; color: var(--muted); text-align: center; }
.kid-note { margin-top: 20px; padding: 12px 14px; border-radius: 12px; background: var(--teal-soft); color: var(--teal); font-size: 0.88rem; font-weight: 600; }
.plan-badge { display: inline-block; margin-bottom: 12px; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 0.82rem; font-weight: 700; }

/* Other states */
.state-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin-bottom: 16px; background: var(--teal-soft); color: var(--teal); }
.state-icon.ok { background: #e5f4e4; color: var(--ok); }
.state-icon.warn { background: var(--accent-soft); color: var(--accent-ink); }
#sent-text strong, #done-text strong { color: var(--ink); word-break: break-all; }
.tips { margin: 16px 0 12px; padding-left: 20px; display: grid; gap: 6px; font-size: 0.9rem; color: var(--ink-2); }
.proto-note { margin-bottom: 8px; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 10px; font-size: 0.82rem; color: var(--muted); }
.resent-note { margin-top: 8px; text-align: center; font-size: 0.88rem; font-weight: 600; color: var(--ok); }
.resent-note::before { content: "✓ "; }
.spinner { width: 44px; height: 44px; margin-bottom: 16px; border: 4px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Desktop info panel: hidden on phones and tablets */
.auth-aside { display: none; }

/* Prototype-only state switcher */
.proto-states { margin-top: 24px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.82rem; color: var(--muted); }
.proto-states span { width: 100%; }
.proto-states button { min-height: 36px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: 0.82rem; font-weight: 600; }
.proto-states button.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Slim footer */
.auth-footer { padding: 20px 0 calc(24px + env(safe-area-inset-bottom)); font-size: 0.85rem; color: var(--muted); }
.auth-footer .wrap { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: center; align-items: center; }
.auth-footer a { color: var(--ink-2); text-decoration: none; padding: 8px 0; }

@media (min-width: 768px) {
  .auth { padding: 48px 0 56px; }
  .auth-card { padding: 36px; max-width: 480px; width: 100%; justify-self: center; }
  .auth-card h1 { font-size: 1.9rem; }
  [data-state] > .btn { width: 100%; }
  .proto-states { max-width: 480px; margin-inline: auto; }
  .proto-states span { width: auto; margin-right: 4px; }
}

@media (min-width: 1000px) {
  .auth-grid { grid-template-columns: 1fr 480px; align-items: stretch; gap: 48px; }
  .auth-card { justify-self: stretch; }
  .auth-aside { display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 48px; border-radius: 24px; background: var(--ink); color: #fff; }
  .auth-aside h2 { font-size: 2.2rem; }
  .aside-eyebrow { color: var(--gold); }
  .aside-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; color: #c9cbe0; font-size: 1.05rem; }
  .aside-list li { position: relative; padding-left: 30px; }
  .aside-list li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 0.75rem; font-weight: 800; display: grid; place-items: center; margin-top: 3px; }
  .aside-staff { margin-top: 12px; width: 100%; max-width: 360px; }
  .proto-states { max-width: none; }
}
