/* Sign-in and app-linking pages. Uses the tokens in base.css. */
.auth-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 100vh; min-height: 100svh; }
/* The header comes from site.css, the same as every other page; it is --header-h tall (base.css) and fixed. */
.auth-main { display: flex; flex-direction: column; padding: calc(var(--header-h) + 24px) clamp(18px, 5vw, 64px) 32px; }

.auth-card { width: 100%; max-width: 420px; margin: auto; padding: 32px 0; }
.auth-card h1 { margin: 0 0 10px; font-size: clamp(38px, 5vw, 50px); line-height: 1.02; }
.auth-card h1:focus { outline: none; }
.auth-sub { margin-bottom: 28px; font-size: 16px; line-height: 1.55; color: var(--ink-soft); }
.auth-sub strong { color: var(--ink); overflow-wrap: anywhere; }
.auth-sub.center { text-align: center; margin: 18px 0 0; }

.context {
  display: flex; align-items: center; gap: 10px; margin-bottom: 22px; padding: 10px 14px; border-radius: 12px;
  background: var(--accent-soft); font-size: 14px; font-weight: 500;
}
.context .icon { color: var(--accent); }

.oauth { display: grid; gap: 10px; }
.btn-oauth {
  display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 50px; padding: 0 18px;
  border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); cursor: pointer;
  font-size: 15px; font-weight: 600; color: var(--ink); transition: border-color .2s, background-color .2s, transform .2s;
}
.btn-oauth:hover { border-color: var(--ink-faint); transform: translateY(-1px); }
.btn-oauth:active { transform: none; }

.divider { display: flex; align-items: center; gap: 14px; margin: 24px 0; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

form { display: grid; gap: 8px; }
label { font-size: 13.5px; font-weight: 600; }
input[type="email"], input[type="text"] {
  width: 100%; min-height: 50px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface);
  font-size: 16px; color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
input::placeholder { color: var(--ink-faint); }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input[aria-invalid="true"] { border-color: var(--del); }
.code-input { text-align: center; font: 600 22px/1 ui-monospace, 'Cascadia Code', Consolas, monospace !important; letter-spacing: .28em; text-transform: uppercase; }
.field-error { font-size: 13.5px; color: var(--del); }
form .btn { margin-top: 10px; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after {
  content: ''; position: absolute; width: 18px; height: 18px; border: 2px solid var(--bg); border-right-color: transparent; border-radius: 50%;
  animation: spin .8s linear infinite;
}
.btn-ghost.is-busy::after { border-color: var(--ink); border-right-color: transparent; }

.auth-hint { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.auth-hint .icon { width: 18px; height: 18px; margin-top: 1px; color: var(--accent); }
.auth-switch { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 14.5px; color: var(--ink-soft); }
.text-btn { padding: 0; border: 0; background: none; cursor: pointer; font-weight: 600; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.auth-switch a { font-weight: 600; color: var(--accent); text-underline-offset: 3px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px; padding: 0; border: 0; background: none; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.back-link:hover { color: var(--ink); }
.back-link .icon { width: 18px; height: 18px; }
.notice { margin-top: 20px; }
.auth-legal { max-width: 420px; margin: 0 auto; text-align: center; font-size: 12.5px; line-height: 1.55; color: var(--ink-faint); }
.auth-legal a { color: var(--ink-soft); }

/* linking */
.device-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface); }
.device-card .icon { width: 28px; height: 28px; color: var(--accent); }
.device-card strong { display: block; font-size: 16px; }
.device-card span { font-size: 13.5px; color: var(--ink-soft); }
.code-label { margin: 26px 0 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.user-code {
  margin: 0 0 26px; padding: 18px; border: 1px dashed var(--line-strong); border-radius: 16px; background: var(--surface-2); text-align: center;
  font: 700 34px/1 ui-monospace, 'Cascadia Code', Consolas, monospace; letter-spacing: .14em; color: var(--ink);
}
.user-code-lg { font-size: clamp(24px, 6vw, 34px); letter-spacing: .08em; margin: 6px 0 16px; }
.stack { display: grid; gap: 10px; }
.device-list { display: grid; gap: 8px; margin: 0 0 6px; padding: 0; border: 0; }
.device-option {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface);
  cursor: pointer; font-weight: 400;
}
.device-option:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.device-option input { width: 18px; height: 18px; accent-color: var(--accent); }
.device-option strong { display: block; font-size: 15px; }
.device-option span { font-size: 13px; color: var(--ink-soft); }
.done-mark { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 22px; border-radius: 50%; background: var(--ins-bg); color: var(--ins); }
.done-mark .icon { width: 28px; height: 28px; stroke-width: 2.2; }
.spinner { width: 36px; height: 36px; margin: 20px auto 0; border: 3px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* the painted panel */
.auth-art { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--bg-2); }
.auth-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-art::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 38%, color-mix(in srgb, var(--bg) 82%, transparent) 78%, var(--bg));
}
.art-copy { position: absolute; left: clamp(28px, 4vw, 56px); right: clamp(28px, 4vw, 56px); bottom: clamp(32px, 6vh, 64px); z-index: 1; }
.art-copy h2 { margin: 0 0 18px; max-width: 520px; font-size: clamp(32px, 3.4vw, 46px); line-height: 1.04; }
.ticks { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ticks li { position: relative; padding-left: 26px; font-size: 15px; line-height: 1.5; color: var(--ink-soft); }
.ticks li::before {
  content: ''; position: absolute; left: 2px; top: .42em; width: 12px; height: 7px; border-left: 1.8px solid var(--accent); border-bottom: 1.8px solid var(--accent); transform: rotate(-45deg);
}

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-card { margin: 0 auto; padding: 28px 0 40px; }
}
@media (prefers-reduced-motion: reduce) { .spinner, .btn.is-busy::after { animation-duration: 2.4s; } }

/* account page */
.acct-h { margin: 30px 0 12px; font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }
.acct-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.acct-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); }
.acct-row > svg, .acct-row > .icon { width: 22px; height: 22px; flex: none; color: var(--accent); }
.acct-row .acct-text { flex: 1; min-width: 0; }
.acct-row strong { display: block; font-size: 15px; overflow-wrap: anywhere; }
.acct-row span { font-size: 13px; color: var(--ink-soft); }
.acct-note { margin: 10px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); }
.acct-signout { margin-top: 32px; }

/* The Terms agreement on the sign-in page. */
.consent { margin-bottom: 18px; }
.consent-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); cursor: pointer; font-size: 14px; line-height: 1.5; color: var(--ink-soft); }
.consent-row input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; }
.consent-row a { color: var(--ink); text-underline-offset: 3px; }
.consent-row:has(input[aria-invalid="true"]) { border-color: var(--del); }
.consent .field-error { margin-top: 8px; }
