/* Sign in to download. Layout and states: docs/plans/2026-10-14-design-language/sign-in-visual-spec.md.
   Builds on styles.css tokens; --line-strong is the only added colour (input boundaries, 3.49:1 on --bg). */
:root {
  --line-strong: #6a6585;
  --danger: #ef8a80;
}

.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; min-height: 100dvh; background: var(--bg); }

/* Views and messages toggle with the hidden attribute; component display rules must not override it. */
.auth [hidden] { display: none !important; }

/* ---------- story panel ---------- */
.story {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  padding: 44px 56px; background: var(--bg-2); border-right: 1px solid var(--line);
}
.story > :not(.story-art) { position: relative; z-index: 1; }
.story-logo { display: block; align-self: flex-start; height: 40px; }
.story-logo svg { height: 40px; width: auto; display: block; }
.story-copy { display: flex; flex-direction: column; gap: 20px; }
.story .eyebrow { letter-spacing: 1.4px; }
.story-title {
  font-family: var(--display); font-weight: 800; font-size: clamp(40px, 4.6vw, 64px);
  letter-spacing: -0.025em; line-height: 1.05; color: var(--text); text-wrap: balance;
}
.story-title span { color: var(--violet-3); }
.story-lede { font-size: 15px; line-height: 1.6; color: var(--text-2); max-width: 38ch; }
.story-foot { font-size: 12px; color: var(--muted); }
.story-art { position: absolute; z-index: 0; width: 720px; height: 720px; right: -200px; bottom: -260px; color: var(--lav); pointer-events: none; }

/* ---------- form column ---------- */
.form-col { display: grid; place-items: center; padding: 48px; }
.box { width: 100%; max-width: 400px; }
.box h1 {
  font-family: var(--display); font-weight: 800; font-size: 36px; letter-spacing: -0.02em; color: var(--text); margin-bottom: 12px;
}
.box h1:focus { outline: none; }
.box h1.state-title { font-size: 28px; }
.platforms { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; font-size: 13px; color: var(--muted); }
.platforms::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.box .lede { font-size: 15px; line-height: 1.6; color: var(--text-2); margin-bottom: 24px; }
.box .lede strong { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.box svg[viewBox="0 0 24 24"]:not([fill]) { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- provider buttons ---------- */
.auth-provider {
  display: flex; align-items: center; gap: 14px; width: 100%; height: 52px; padding: 0 16px; margin-bottom: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; color: var(--text);
  font-size: 15px; font-weight: 600; text-align: left; cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.auth-provider:hover:not(:disabled) { border-color: var(--muted); background: #22212d; }
.auth-provider:active:not(:disabled) { background: var(--lav); }
.auth-provider .p-icon { display: grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0; }
.auth-provider .g-tile { background: #fff; border-radius: 6px; }
.auth-provider .chev { margin-left: auto; color: var(--muted); transition: transform 0.15s var(--ease-out); }
.auth-provider:hover:not(:disabled) .chev { transform: translateX(2px); }
.auth-provider:disabled { cursor: default; }
.auth-provider:disabled:not(.is-busy) { opacity: 0.55; }
.auth-provider.is-busy .p-icon { background: none; color: var(--text-2); }

/* ---------- divider ---------- */
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; font-size: 12px; color: var(--muted); }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- fields ---------- */
.email-form { display: flex; flex-direction: column; gap: 14px; }
.email-panel { margin-top: 8px; }
.email-back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.email-back::before { content: '‹'; margin-right: 6px; font-size: 16px; line-height: 1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.field input {
  width: 100%; height: 44px; padding: 0 12px; font: inherit; font-size: 15px; color: var(--text);
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 8px;
}
.field input:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; border-radius: 8px; }
.field input[aria-invalid='true'] { border-color: var(--danger); }
.field input:disabled { opacity: 0.55; }
.pw { position: relative; }
.pw input { padding-right: 68px; }
.pw-toggle {
  position: absolute; right: 4px; top: 4px; height: 36px; min-width: 56px; padding: 0 10px;
  background: none; border: 0; border-radius: 6px; color: var(--text-2); font-size: 13px; cursor: pointer;
}
.pw-toggle:hover { color: var(--text); }
.hint { font-size: 12.5px; color: var(--muted); }
.field-error { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; line-height: 1.45; color: var(--danger); }
.field-error svg { flex-shrink: 0; margin-top: 1px; }
.forgot { align-self: flex-end; min-height: 32px; padding: 0; background: none; border: 0; font-size: 13px; color: var(--violet-3); cursor: pointer; }
.forgot:hover { color: var(--text); }

/* ---------- buttons ---------- */
.submit { width: 100%; height: 48px; font-size: 15px; margin-top: 4px; }
.submit:disabled { cursor: default; transform: none; }
.submit:disabled:not(.is-busy) { opacity: 0.55; }
.btn-spin { display: none; }
.is-busy .btn-spin { display: inline-grid; }
.btn-spin svg, svg.spin { animation: auth-spin 0.9s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
.textlink {
  padding: 0; background: none; border: 0; font: inherit; color: var(--text); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.textlink:hover { color: var(--violet-3); }
.textlink:disabled { opacity: 0.55; cursor: default; }
.switch { margin-top: 18px; font-size: 13px; color: var(--muted); text-align: center; }
.switch .textlink { min-height: 32px; font-weight: 600; }
.terms { margin-top: 24px; font-size: 12px; line-height: 1.6; color: var(--muted); text-align: center; }
.terms a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.terms a:hover { color: var(--text); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 16px; font-size: 13px; }
.row .pill { min-height: 44px; }
.row .textlink { color: var(--text-2); min-height: 44px; }
.email-form [disabled], .auth-provider[disabled] { pointer-events: none; }

/* ---------- notices ---------- */
.notice {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; padding: 12px 14px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.5; color: var(--text);
}
.notice svg { flex-shrink: 0; margin-top: 2px; }
.notice.error { background: #ef8a8014; border: 1px solid #ef8a8055; }
.notice.error svg { color: var(--danger); }
.notice.neutral { background: var(--panel); border: 1px solid var(--line-strong); color: var(--text-2); }
.notice.ok { background: var(--panel); border: 1px solid var(--line-strong); color: var(--text-2); }
.notice.ok svg { color: var(--green); }
.confirm { display: flex; align-items: flex-start; gap: 8px; margin-top: 16px; font-size: 13.5px; line-height: 1.5; color: var(--green); }
.confirm svg { flex-shrink: 0; margin-top: 2px; }
.confirm strong { overflow-wrap: anywhere; }

/* ---------- states ---------- */
.state-icon { display: block; margin-bottom: 18px; color: var(--violet-3); }
.center-state { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 40px 0; color: var(--text-2); font-size: 14px; }
.center-state svg { color: var(--violet-3); }
.dl-status { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13.5px; color: var(--text-2); }
.dl-status svg { flex-shrink: 0; }
.dl-detail { font-size: 13px; color: var(--muted); }
.account { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.account .textlink { color: var(--text-2); min-height: 32px; }

@media (prefers-reduced-motion: reduce) {
  .auth-provider .chev, .auth-provider:hover:not(:disabled) .chev { transition: none; transform: none; }
}

/* ---------- mobile: story collapses to a brand strip ---------- */
@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .story { height: 64px; padding: 0 24px; flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); }
  .story-copy, .story-foot, .story-art { display: none; }
  .story-logo, .story-logo svg { height: 28px; }
  .story-logo { align-self: center; }
  .form-col { padding: 32px 24px; min-height: calc(100vh - 64px); min-height: calc(100dvh - 64px); place-items: start center; }
  .box h1 { font-size: 30px; }
  .box h1.state-title { font-size: 26px; }
}
