/* CantoWork — sign-in, onboarding and app hand-off (signin.html).
   Builds on site.css tokens: paper, ink, iris→cyan signal, Geist. */

body.auth { min-height: 100vh; background: var(--paper); }
.auth-shell {
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(400px, 0.92fr);
  min-height: 100vh; padding: 14px; gap: 14px;
}

/* ── stage ── */
.auth-stage {
  position: relative; overflow: hidden; border-radius: 28px;
  background:
    radial-gradient(120% 80% at 50% 108%, rgba(107, 92, 255, 0.16), transparent 60%),
    radial-gradient(80% 60% at 18% 0%, rgba(34, 211, 238, 0.10), transparent 60%),
    var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.auth-stage::before { /* quiet dot matrix */
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(22, 22, 27, 0.13) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 75% 60% at 50% 30%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 75% 60% at 50% 30%, #000 20%, transparent 75%);
}
.auth-stage::after { /* soft floor line the crew stands on */
  content: ""; position: absolute; left: 8%; right: 8%; bottom: 22%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(22, 22, 27, 0.10), transparent);
}
#crew { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; }
.auth-stage-brand {
  position: absolute; z-index: 2; top: 24px; left: 26px;
  display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; letter-spacing: -0.02em;
}
.auth-stage-note {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 26px; margin: 0;
  text-align: center; font-size: 14px; color: var(--muted);
  transition: opacity 0.4s var(--ease);
}
.crew-2d[hidden] { display: none; }
.crew-2d { position: absolute; inset: auto 0 24% 0; z-index: 1; display: flex; justify-content: center; align-items: flex-end; }
.crew-2d .mascot { width: 120px; }
.crew-2d .mascot.lead { width: 160px; }

/* ── panel ── */
.panel { position: relative; display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.panel-inner { width: min(400px, 100%); }
.panel-brand { display: inline-flex; margin-bottom: 22px; }
.panel-brand img { border-radius: 8px; }
.app-chip[hidden] { display: none; }
.app-chip {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 6px 12px; border-radius: 999px;
  font-size: 13px; color: var(--ink-2); background: var(--card); box-shadow: var(--shadow-hair);
}
.app-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18); }
.panel h1 { margin: 0 0 6px; font-size: 34px; line-height: 1.12; font-weight: 500; letter-spacing: -0.04em; }
.panel h1 .serif { background: var(--signal); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 3px; }
.panel .sub { margin: 0 0 24px; color: var(--muted); font-size: 15.5px; }
.panel .sub b { color: var(--ink); font-weight: 500; }

.view { display: none; }
.view.on { display: block; animation: view-in 0.45s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } }

.oauth { display: grid; gap: 10px; }
.oauth-btn { width: 100%; height: 48px; justify-content: center; font-size: 15px; font-weight: 500; }
.oauth-btn svg { width: 18px; height: 18px; }
.oauth-btn.soon, .oauth-btn.soon:hover { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.soon-tag { margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--line-2); color: var(--ink-2, inherit); font-size: 12px; font-weight: 500; }
#f-email input:disabled { cursor: not-allowed; opacity: .6; }
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--faint); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }

.field { display: block; margin-bottom: 14px; }
.field span { display: block; margin: 0 2px 7px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field input {
  display: block; width: 100%; height: 48px; padding: 0 16px; border: 0; outline: 0; border-radius: 14px;
  font: inherit; font-size: 15.5px; color: var(--ink); background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow 0.18s var(--ease);
}
.field input::placeholder { color: var(--faint); }
.field input:focus { box-shadow: inset 0 0 0 1.5px var(--iris), 0 0 0 4px rgba(107, 92, 255, 0.12); }
.field.err input { box-shadow: inset 0 0 0 1.5px var(--coral), 0 0 0 4px rgba(255, 107, 94, 0.12); }
.btn.wide { width: 100%; justify-content: center; height: 50px; }
.btn.btn-lg.wide { height: 56px; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.fine { margin: 16px 2px 0; font-size: 12.5px; color: var(--faint); line-height: 1.5; }
.fine a, .open-help a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }

.code-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 16px; }
.code-row input {
  width: 100%; height: 58px; border: 0; outline: 0; border-radius: 14px; text-align: center;
  font: inherit; font-size: 24px; font-weight: 500; color: var(--ink); background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow 0.18s, transform 0.18s var(--ease);
}
.code-row input:focus { box-shadow: inset 0 0 0 1.5px var(--iris), 0 0 0 4px rgba(107, 92, 255, 0.12); transform: translateY(-1px); }
.code-row.err input { box-shadow: inset 0 0 0 1.5px var(--coral); animation: nope 0.4s; }
@keyframes nope { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.row-links { display: flex; justify-content: space-between; margin-top: 14px; }
.link { border: 0; background: none; padding: 4px 2px; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; border-radius: 6px; }
.link:hover { color: var(--ink); }
.link[disabled] { opacity: 0.5; pointer-events: none; }

/* survey */
.steps { display: flex; gap: 6px; margin-bottom: 22px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line-2); overflow: hidden; position: relative; }
.steps i::after { content: ""; position: absolute; inset: 0; background: var(--signal); transform: scaleX(0); transform-origin: left; transition: transform 0.45s var(--ease); }
.steps i.on::after { transform: scaleX(1); }
.q { display: none; }
.q.on { display: block; animation: view-in 0.4s var(--ease) both; }
.qlabel { margin: 18px 2px 10px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-opt {
  height: 38px; padding: 0 15px; border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 14px; color: var(--ink-2); background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2);
  transition: box-shadow 0.15s, background 0.15s, color 0.15s, transform 0.15s var(--ease);
}
.chip-opt:hover { box-shadow: inset 0 0 0 1px var(--ink); transform: translateY(-1px); }
.chip-opt[aria-pressed="true"] { color: #fff; background: var(--ink); box-shadow: 0 6px 16px -8px rgba(107, 92, 255, 0.7), inset 0 0 0 1px var(--ink); }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--iris); }
.survey-nav { display: flex; align-items: center; gap: 10px; margin-top: 26px; }
.survey-nav .grow { flex: 1; }
.survey-nav .btn { height: 44px; padding: 0 22px; }

/* done */
.open-help { margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: var(--paper-2); font-size: 13.5px; color: var(--muted); }
.open-help p { margin: 0 0 6px; } .open-help p:last-child { margin: 0; }
.who { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding: 12px 14px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow-hair); }
.who .avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; background: var(--signal) center / cover; }
.who b { display: block; font-weight: 500; font-size: 14.5px; }
.who small { display: block; color: var(--muted); font-size: 12.5px; }
.who > span:nth-child(2) { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .link { font-size: 13px; white-space: nowrap; }

.msg { min-height: 22px; margin-top: 14px; font-size: 14px; color: var(--muted); }
.msg.err { color: #d9443a; }
.busy {
  position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(251, 250, 247, 0.86); backdrop-filter: blur(6px); color: var(--ink-2); font-size: 15px;
}
.busy[hidden] { display: none; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--iris); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; grid-template-rows: 300px auto; padding: 10px; gap: 6px; }
  .auth-stage { border-radius: 22px; }
  .auth-stage-note { display: none; }
  .panel { padding: 22px 16px 36px; align-items: flex-start; }
  .panel-brand { display: none; }
  .panel h1 { font-size: 29px; }
  .crew-2d .mascot { width: 84px; } .crew-2d .mascot.lead { width: 112px; }
}
@media (max-width: 380px) { .code-row { gap: 5px; } .code-row input { height: 50px; font-size: 20px; } }
@media (prefers-reduced-motion: reduce) { .view.on, .q.on, .code-row.err input { animation: none; } }
.fix-email { font-size: inherit; color: var(--iris); padding: 0; text-decoration: underline; text-underline-offset: 2px; }
