/* Auth chrome. Scoped under .auth-shell so the signed-in portal keeps its own tokens. */
@font-face { font-family: "Libre Caslon Display"; src: url("/fonts/libre-caslon-display-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url("/fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

.auth-shell {
  --ink: #141312;
  --paper: #EBEBE8;
  --sheet: #F6F6F3;
  --paper-2: #E1E1DC;
  --field: #FBFBF9;
  --text-2: #3C3934;
  --text-3: #57534C;
  --text-disabled: #6F6A62;
  --rule: #CFCDC6;
  --rule-strong: #8F897F;
  --action: #A63A2B;
  --action-hover: #8C2F22;
  --action-press: #74261B;
  --on-action: #F6F5F2;
  --focus: #141312;
  --f-display: "Libre Caslon Display", "Times New Roman", serif;
  --f-ui: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --t-13: 13px;
  --t-14: 14px;
  --t-16: 16px;
  --t-30: 30px;
  --t-40: 40px;
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-8: 64px;
  --s-9: 96px;
  --r-2: 4px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sheet);
  color: var(--ink);
  font: 400 var(--t-16)/1.55 var(--f-ui);
}
.auth-shell .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.auth-shell .auth-bar {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 var(--s-6);
  background: var(--ink);
  flex: none;
}
.auth-shell .auth-bar .wordmark {
  font: 400 22px/1 var(--f-display);
  letter-spacing: -0.01em;
  color: var(--paper);
  text-decoration: none;
}
.auth-shell .auth-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--s-8) var(--s-5) var(--s-9);
}
.auth-shell .auth-card { width: 100%; max-width: 420px; }
.auth-shell .auth-card .t-title {
  margin: 0 0 var(--s-2);
  font: 400 var(--t-40)/1.1 var(--f-display);
  letter-spacing: -0.012em;
  color: var(--ink);
}
.auth-shell .lead {
  margin: 0 0 var(--s-5);
  color: var(--text-2);
  font-size: var(--t-16);
  line-height: 1.55;
}
.auth-shell .lead b { font-weight: 600; color: var(--ink); word-break: break-word; }
.auth-shell form { display: grid; gap: var(--s-5); }
.auth-shell .field { display: grid; gap: var(--s-2); margin: 0; }
.auth-shell .field > label { font-weight: 600; font-size: var(--t-14); color: var(--ink); }
.auth-shell .helper { margin: 0; font-size: var(--t-13); color: var(--text-3); line-height: 1.45; }
.auth-shell .input {
  height: 48px;
  width: 100%;
  padding: 0 var(--s-3);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-2);
  background: var(--field);
  font: 400 var(--t-16)/1 var(--f-ui);
  color: var(--ink);
}
.auth-shell .input:hover { border-color: var(--text-3); }
.auth-shell .input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--ink); }
.auth-shell .input.is-error { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.auth-shell .input::placeholder { color: var(--text-3); }
.auth-shell .code-in {
  height: 56px;
  font: 500 28px/1 "Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.28em;
  text-align: center;
  padding: 0 var(--s-4);
  font-variant-numeric: tabular-nums;
}
.auth-shell .code-in::placeholder { letter-spacing: 0.28em; color: var(--text-3); }
.auth-shell .field-error { margin: 0; font-size: var(--t-13); color: var(--ink); font-weight: 500; line-height: 1.4; }
.auth-shell .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--r-2);
  font: 500 var(--t-14)/1 var(--f-ui);
  white-space: nowrap;
  cursor: pointer;
  background: transparent;
  color: var(--ink);
}
.auth-shell .btn.wide { width: 100%; }
.auth-shell .btn.btn-lg { height: 52px; padding: 0 26px; font-size: var(--t-16); }
.auth-shell .btn.btn-primary { background: var(--action); color: var(--on-action); }
.auth-shell .btn.btn-primary:hover { background: var(--action-hover); }
.auth-shell .btn.btn-primary:active { background: var(--action-press); }
.auth-shell .btn:disabled,
.auth-shell .btn[aria-disabled="true"] { background: var(--paper-2); color: var(--text-disabled); border-color: transparent; cursor: not-allowed; }
.auth-shell .auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  margin-top: var(--s-5);
  font-size: var(--t-14);
  color: var(--text-3);
}
.auth-shell .auth-links .sep { color: var(--rule-strong); }
.auth-shell .auth-links a,
.auth-shell .auth-links .textlink {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.auth-shell .auth-links button:disabled,
.auth-shell .auth-links .textlink:disabled { color: var(--text-disabled); cursor: not-allowed; text-decoration: none; }
.auth-shell .trust {
  margin: var(--s-5) 0 0;
  padding-top: var(--s-5);
  border-top: 1px solid var(--rule);
  font-size: var(--t-13);
  color: var(--text-3);
  line-height: 1.5;
}
.auth-shell .cross {
  margin: var(--s-5) 0 0;
  padding-top: var(--s-5);
  border-top: 1px solid var(--rule);
  display: grid;
  gap: var(--s-3);
  font-size: var(--t-14);
  color: var(--text-3);
}
.auth-shell .cross p { margin: 0; }
.auth-shell .cross a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 5px; }
.auth-shell .invite-meta {
  margin: 0 0 var(--s-5);
  padding: var(--s-4);
  background: var(--field);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  display: grid;
  gap: var(--s-1);
  font-size: var(--t-14);
}
.auth-shell .invite-meta .k { color: var(--text-3); font-size: var(--t-13); }
.auth-shell .invite-meta .v { font-weight: 600; color: var(--ink); word-break: break-word; }
.auth-shell .status-banner {
  margin: 0 0 var(--s-5);
  padding: var(--s-4);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-2);
  background: var(--paper-2);
  font-size: var(--t-14);
  line-height: 1.45;
  color: var(--ink);
}
.auth-shell .status-banner strong { display: block; margin-bottom: var(--s-1); font-weight: 600; }
.auth-shell .auth-foot {
  flex: none;
  padding: var(--s-5) var(--s-6);
  border-top: 1px solid var(--rule);
  font-size: var(--t-13);
  color: var(--text-3);
  text-align: center;
}
.auth-shell .auth-foot p { margin: 0; }
.auth-shell .auth-foot a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 4px; }
.auth-shell .toast {
  position: static;
  opacity: 1;
  pointer-events: auto;
  margin: 0 0 var(--s-4);
  padding: var(--s-3) var(--s-4);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r-2);
  font-size: var(--t-14);
  font-weight: 500;
}
body.auth-body { margin: 0; min-height: 100vh; background: #F6F6F3; color: #141312; }
.auth-shell .btn.is-busy { gap: 0; cursor: wait; }
.auth-shell .btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 10px;
  border: 2px solid color-mix(in srgb, var(--on-action) 35%, transparent);
  border-top-color: var(--on-action);
  border-radius: 50%;
  animation: ck-spin 0.7s linear infinite;
  vertical-align: -3px;
  flex-shrink: 0;
}
.auth-shell .btn-spinner.on-ink,
.auth-shell .textlink .btn-spinner {
  border-color: color-mix(in srgb, var(--ink) 25%, transparent);
  border-top-color: var(--ink);
}
.auth-shell .btn.btn-primary.is-busy:disabled,
.auth-shell .btn.btn-primary.is-busy[aria-disabled="true"] {
  background: var(--action);
  color: var(--on-action);
  border-color: transparent;
  opacity: 0.92;
  cursor: wait;
}
.auth-shell .auth-links .textlink.is-busy:disabled { color: var(--ink); cursor: wait; text-decoration: none; }
.auth-shell .auth-foot .textlink {
  background: none;
  border: 0;
  padding: 0;
  margin-top: 8px;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 4px;
}
.auth-shell .auth-foot p + p { margin-top: 8px; }
@keyframes ck-spin { to { transform: rotate(360deg); } }
.auth-shell .mail-off h2 { margin: 0 0 var(--s-2); font: 600 22px/1.3 var(--f-ui); }
.auth-shell .mail-off p { margin: 0; color: var(--text-2); }
@media (max-width: 720px) {
  .auth-shell .auth-main { padding: 32px 16px 64px; }
  .auth-shell .auth-card .t-title { font-size: var(--t-30); }
  .auth-shell .auth-bar { padding: 0 var(--s-4); }
  .auth-shell .code-in { font-size: 24px; letter-spacing: 0.22em; }
}
