/* Keystone CRM — authentication UI
   Visual direction: form column + brand artwork panel (shared/art.jpg),
   Plus Jakarta Sans, hairline fields, glossy near-black primary. */

@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap");

:root {
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* neutrals */
  --canvas: #e4e4e2;
  --surface: #ffffff;
  --surface-soft: #f2f2f1;
  --surface-sunken: #f7f7f6;
  --fg: #111613;
  --fg-2: #3f4542;
  --muted: #6a706d;
  --border: #e3e4e3;
  --border-strong: #cdd0ce;

  /* accents */
  --brand: #ff5e20;  /* primary action colour */
  --accent: #2f6bff;
  --accent-ink: #1f4fd1;
  --focus: rgb(47 107 255 / 0.32);
  --danger: #c5302a;
  --danger-bg: #fdf2f1;
  --danger-line: #f5d3d0;
  --warn: #8a4b06;
  --warn-bg: #fff7e8;
  --warn-line: #f6e1b8;
  --success: #1c7346;
  --success-bg: #eef7f1;
  --success-line: #cfe8d9;
  --info: #1f4fd1;
  --info-bg: #f0f4ff;
  --info-line: #d6e1fd;

  /* shape */
  --r-frame: 18px;
  --r-panel: 14px;
  --r-card: 12px;
  --r-control: 10px;
  --r-full: 999px;
  --control-h: 52px;

  --shadow-card: 0 1px 2px rgb(16 24 20 / 0.04), 0 8px 24px -12px rgb(16 24 20 / 0.12);
  --shadow-pop: 0 24px 60px -20px rgb(16 24 20 / 0.35);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font: 400 16px/1.5 var(--font);
  color: var(--fg);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: 0.88em; }
svg.lucide { width: 20px; height: 20px; stroke-width: 1.75; flex: none; }
[hidden] { display: none !important; }

:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); border-radius: 6px; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 50;
  padding: 8px 12px; border-radius: var(--r-control);
  background: var(--fg); color: #fff; font-weight: 500;
}
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───────── Brand ───────── */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; font-size: 21px; letter-spacing: -0.01em; color: var(--fg); }
.brand:hover { text-decoration: none; }
.mark { width: 32px; height: 32px; flex: none; }

/* ───────── Auth layout (full viewport split) ───────── */
body.auth-page { background: var(--surface); }
.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); /* form left, art right */
  min-height: 100dvh;
}

/* Art panel — pinned full-height on the right while the form column scrolls */
.art {
  position: sticky; top: 0;
  height: calc(100dvh - 24px);
  margin: 12px 12px 12px 0;
  overflow: hidden;
  isolation: isolate;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(24px, 3vw, 40px);
  border-radius: var(--r-panel);
  background: #3a0a19 url("art.jpg") center / cover no-repeat; /* brand artwork */
}
/* Form column */
.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; min-width: 0; }
.auth-col { width: min(100%, 440px); }

/* ───────── Screen header ───────── */
.screen { display: grid; gap: 30px; }
.screen.enter { animation: enter 0.38s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
.screen-head { display: grid; justify-items: center; gap: 10px; text-align: center; }
.screen-head h1 { font-size: 34px; line-height: 1.2; font-weight: 500; letter-spacing: -0.02em; }
.screen-head h1:focus { box-shadow: none; }
.screen-head p { color: var(--muted); font-size: 17px; max-width: 36ch; }
.kicker { font-size: 14px; font-weight: 500; color: var(--muted); padding: 5px 12px; border-radius: var(--r-full); background: var(--surface-soft); }

/* Status icon tile (success / warning / etc.) */
.status-icon { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 10px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface-sunken); color: var(--fg); }
.status-icon svg.lucide { width: 30px; height: 30px; }
.status-icon[data-tone="success"] { background: var(--success-bg); border-color: var(--success-line); color: var(--success); }
.status-icon[data-tone="warning"] { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.status-icon[data-tone="danger"]  { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }
.status-icon[data-tone="info"]    { background: var(--info-bg); border-color: var(--info-line); color: var(--info); }

/* ───────── Form ───────── */
form { display: grid; gap: 22px; }
.form-body { display: grid; gap: 22px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field { display: grid; gap: 9px; }
.field-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.label { font-size: 15.5px; font-weight: 500; color: var(--fg); }
.field-row a { font-size: 15px; font-weight: 500; }
.control { position: relative; display: flex; }
.input {
  width: 100%; height: var(--control-h);
  padding: 0 16px;
  font-size: 16.5px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-control);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.input::placeholder { color: #9a9f9c; }
.input:hover { border-color: #b8bcba; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.input[readonly] { background: var(--surface-sunken); color: var(--fg-2); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgb(197 48 42 / 0.2); }
.form-body:disabled .input { background: var(--surface-sunken); color: var(--muted); }
.control .input:has(+ .reveal) { padding-right: 54px; }
.reveal {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 44px; height: 42px;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.reveal:hover { color: var(--fg); background: var(--surface-soft); }
.field-error { display: flex; gap: 6px; align-items: flex-start; color: var(--danger); font-size: 15px; font-weight: 500; }
.field-error svg.lucide { width: 17px; height: 17px; margin-top: 2px; }
.hint { color: var(--muted); font-size: 15px; }

/* ───────── Buttons ─────────
   3D treatment: a permanent sheen layer (::after, behind the label) + stacked
   inset bevel (no drop shadow). Hover intensifies the sheen;
   active presses it down. Focus uses outline so the depth shadows survive. */
.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--control-h); padding: 0 22px;
  font-size: 16.5px; font-weight: 500; white-space: nowrap;
  border: 0; border-radius: var(--r-control);
  cursor: pointer; text-decoration: none !important;
  transition: background 0.2s, box-shadow 0.2s, transform 0.12s var(--ease), color 0.15s;
}
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgb(255 255 255 / var(--sheen, 0.14)) 0%, rgb(255 255 255 / calc(var(--sheen, 0.14) / 3)) 48%, rgb(255 255 255 / 0) 52%);
  transition: opacity 0.2s;
}
.btn:hover:not(:disabled) { --sheen: 0.26; }
.btn:active:not(:disabled) { --sheen: 0.08; transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.btn:disabled { cursor: default; }
.btn-block { width: 100%; }
.btn-sm { height: 40px; padding: 0 15px; font-size: 15px; }

/* Dark primary */
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #3a3f3c 0%, #161917 50%, #050605 100%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.22),
    inset 0 -2px 0 rgb(0 0 0 / 0.45);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #454b47 0%, #1d211f 50%, #080908 100%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.3),
    inset 0 -2px 0 rgb(0 0 0 / 0.45);
}
.btn-primary:active:not(:disabled) {
  background: linear-gradient(180deg, #111312 0%, #1a1d1b 100%);
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 0.5);
}
.btn-primary:disabled:not(.is-loading):not(.is-success) { opacity: 0.45; }

/* Light buttons share one raised-paper look */
.btn-secondary, .btn-outline, .btn-danger-quiet {
  color: var(--fg);
  background: linear-gradient(180deg, #ffffff 0%, #f3f3f2 100%);
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -1px 0 rgb(0 0 0 / 0.06),
    0 0 0 1px var(--border-strong);
  --sheen: 0.6;
}
.btn-secondary:hover:not(:disabled), .btn-outline:hover:not(:disabled), .btn-danger-quiet:hover:not(:disabled) {
  --sheen: 0.9;
  background: linear-gradient(180deg, #ffffff 0%, #ededec 100%);
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -1px 0 rgb(0 0 0 / 0.07),
    0 0 0 1px #b9bdbb;
}
.btn-secondary:active:not(:disabled), .btn-outline:active:not(:disabled), .btn-danger-quiet:active:not(:disabled) {
  --sheen: 0.2;
  background: #efefee;
  box-shadow: inset 0 1px 3px rgb(0 0 0 / 0.12), 0 0 0 1px var(--border-strong);
}
.btn-danger-quiet { color: var(--danger); }

/* Ghost stays flat */
.btn-ghost { color: var(--fg-2); background: transparent; }
.btn-ghost::after { display: none; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-soft); color: var(--fg); transform: none; }

/* Destructive */
.btn-danger {
  color: #fff;
  background: linear-gradient(180deg, #e0463c 0%, #c5302a 50%, #a82520 100%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.25),
    inset 0 -2px 0 rgb(0 0 0 / 0.2);
}
.btn-danger:hover:not(:disabled) {
  background: linear-gradient(180deg, #e8564c 0%, #cd362f 50%, #ae2722 100%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.32),
    inset 0 -2px 0 rgb(0 0 0 / 0.2);
}
.btn-danger:active:not(:disabled) { background: #b12a24; box-shadow: inset 0 2px 4px rgb(0 0 0 / 0.3); }

.btn.is-loading .btn-icon, .btn.is-success .btn-icon { display: none; }
.btn.is-loading::before {
  content: ""; width: 18px; height: 18px; flex: none;
  border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite; opacity: 0.85;
}
.btn.is-success { background: linear-gradient(180deg, #2a9160 0%, #1c7346 55%, #155a37 100%); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25), inset 0 -2px 0 rgb(0 0 0 / 0.25); }
@keyframes spin { to { transform: rotate(360deg); } }

.actions { display: grid; gap: 10px; }

/* Text-style button (Change, Resend code, Use password instead) */
.link-btn { padding: 0; border: 0; background: none; color: var(--accent-ink); font-weight: 500; font-size: inherit; cursor: pointer; }
.link-btn:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 3px; }
.link-btn:disabled { color: var(--muted); cursor: default; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 15px; }

/* One-time code: six single-digit boxes acting as one field */
.otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.otp .input { height: 60px; padding: 0; text-align: center; font-size: 24px; font-weight: 500; font-variant-numeric: tabular-nums; }
.back-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--fg-2); font-size: 16px; font-weight: 500; }
.back-link svg.lucide { width: 18px; height: 18px; }
.foot { text-align: center; color: var(--muted); font-size: 15px; line-height: 1.55; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ───────── Alert ───────── */
.alert {
  display: grid; grid-template-columns: auto 1fr; gap: 3px 12px;
  padding: 15px 17px;
  border-radius: var(--r-card);
  border: 1px solid var(--border);
  background: var(--surface-sunken);
  font-size: 15.5px;
  animation: enter 0.3s var(--ease) both;
}
.alert > svg.lucide { grid-row: span 2; margin-top: 1px; }
.alert-title { font-weight: 500; }
.alert-text { color: var(--fg-2); grid-column: 2; }
.alert-action { grid-column: 2; justify-self: start; margin-top: 8px; }
.alert[data-tone="danger"]  { background: var(--danger-bg);  border-color: var(--danger-line); }
.alert[data-tone="danger"] > svg.lucide { color: var(--danger); }
.alert[data-tone="warning"] { background: var(--warn-bg);    border-color: var(--warn-line); }
.alert[data-tone="warning"] > svg.lucide { color: var(--warn); }
.alert[data-tone="success"] { background: var(--success-bg); border-color: var(--success-line); }
.alert[data-tone="success"] > svg.lucide { color: var(--success); }
.alert[data-tone="info"]    { background: var(--info-bg);    border-color: var(--info-line); }
.alert[data-tone="info"] > svg.lucide { color: var(--info); }

/* ───────── Password requirements + strength ───────── */
.strength { display: grid; gap: 6px; }
.strength-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.strength-bars span { height: 5px; border-radius: 2px; background: var(--surface-soft); transition: background 0.2s; }
.strength[data-score="1"] .strength-bars span:nth-child(-n+1) { background: var(--danger); }
.strength[data-score="2"] .strength-bars span:nth-child(-n+2) { background: #d98a1c; }
.strength[data-score="3"] .strength-bars span:nth-child(-n+3) { background: #3f9a63; }
.strength[data-score="4"] .strength-bars span { background: var(--success); }
.strength-text { display: flex; justify-content: space-between; font-size: 14.5px; color: var(--muted); }
.strength-text b { font-weight: 500; color: var(--fg-2); }

.reqs { list-style: none; margin: 0; padding: 16px 18px; display: grid; gap: 10px; border-radius: var(--r-card); background: var(--surface-sunken); border: 1px solid var(--border); font-size: 15px; color: var(--fg-2); }
.reqs li { display: flex; align-items: center; gap: 10px; }
.reqs li svg.lucide { width: 18px; height: 18px; color: #a3a8a5; }
.reqs li[data-met="true"] { color: var(--fg); }
.reqs li[data-met="true"] svg.lucide { color: var(--success); }
.reqs li .req-on { display: none; }
.reqs li[data-met="true"] .req-on { display: block; }
.reqs li[data-met="true"] .req-off { display: none; }

/* ───────── Detail list (invitation) ───────── */
.details { margin: 0; border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; }
.details > div { display: flex; justify-content: space-between; gap: 16px; padding: 15px 18px; font-size: 15.5px; }
.details > div + div { border-top: 1px solid var(--border); }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 500; text-align: right; min-width: 0; overflow-wrap: anywhere; }

.countdown { font-family: var(--mono); font-size: 15px; font-weight: 500; padding: 2px 8px; border-radius: 6px; background: var(--surface-soft); color: var(--fg); }

/* ───────── App placeholder shell ───────── */
.app { min-height: 100dvh; background: #f6f6f5; }
.app-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 72px; padding: 0 28px; background: rgb(255 255 255 / 0.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.app-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: linear-gradient(140deg, #dbe6ff, #9fbaff); color: #13285c; font-size: 15px; font-weight: 700; }
.app-user-name { font-size: 15.5px; font-weight: 500; line-height: 1.2; }
.app-user-role { font-size: 14px; color: var(--muted); }
.app-main { width: min(1600px, 100%); margin: 0 auto; padding: 48px 32px 96px; }
.page { display: grid; gap: 28px; }
.page.enter { animation: enter 0.38s var(--ease) both; }
.page-head { display: grid; gap: 6px; }
.page-head h1 { font-size: 36px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; }
.page-head h1:focus { box-shadow: none; }
.page-head p { color: var(--muted); max-width: 60ch; font-size: 17px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--muted); margin-bottom: 8px; }
.crumbs svg.lucide { width: 16px; height: 16px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-card); }
.card-pad { padding: 24px; display: grid; gap: 16px; }
.card h2 { font-size: 18px; font-weight: 500; }
.card p { color: var(--muted); font-size: 15.5px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.link-card { display: flex; align-items: center; gap: 16px; padding: 22px 24px; color: var(--fg); transition: border-color 0.15s; }
.link-card:hover { text-decoration: none; border-color: var(--border-strong); }
.link-card > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.link-card strong { font-weight: 500; }
.link-card span { color: var(--muted); font-size: 15.5px; }
.tile { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 13px; background: var(--surface-soft); color: var(--fg); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Sessions */
.session-list { list-style: none; margin: 0; padding: 0; }
.session { display: flex; align-items: center; gap: 16px; padding: 20px 24px; transition: opacity 0.25s, transform 0.25s; }
.session + .session { border-top: 1px solid var(--border); }
.session.leaving { opacity: 0; transform: translateX(8px); }
.session-info { flex: 1; min-width: 0; display: grid; gap: 3px; }
.session-name { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-weight: 500; }
.session-meta { color: var(--muted); font-size: 15px; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: var(--r-full); font-size: 13.5px; font-weight: 500; background: var(--success-bg); color: var(--success); border: 1px solid var(--success-line); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.empty-row { padding: 20px 24px; color: var(--muted); font-size: 15.5px; border-top: 1px solid var(--border); }

/* ───────── Dialog ───────── */
dialog.modal {
  width: min(480px, calc(100% - 32px));
  padding: 0; border: 0; border-radius: 16px;
  background: var(--surface); color: var(--fg);
  box-shadow: var(--shadow-pop);
}
dialog.modal[open] { animation: pop 0.22s var(--ease) both; }
dialog.modal::backdrop { background: rgb(17 22 19 / 0.4); backdrop-filter: blur(2px); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.modal-body { display: grid; gap: 8px; padding: 24px 24px 20px; }
.modal-body h2 { font-size: 21px; font-weight: 500; letter-spacing: -0.01em; }
.modal-body p { color: var(--fg-2); font-size: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px; background: var(--surface-sunken); border-top: 1px solid var(--border); }

/* ───────── Toast ───────── */
.toast-region { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40; width: max-content; max-width: calc(100% - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-radius: 12px; background: var(--fg); color: #fff; font-size: 15.5px; box-shadow: var(--shadow-pop); animation: enter 0.25s var(--ease) both; }
.toast svg.lucide { color: #9ee0b8; }

/* ───────── Prototype panel (demo-only controls) ───────── */
.proto { position: fixed; right: 16px; bottom: 16px; z-index: 30; font-size: 13.5px; display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 8px; }
.proto summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px;
  border-radius: var(--r-full);
  background: rgb(255 255 255 / 0.9); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card); font-weight: 500;
}
.proto summary::-webkit-details-marker { display: none; }
.proto summary svg.lucide { width: 16px; height: 16px; }
.proto[open] summary { background: var(--fg); color: #fff; border-color: var(--fg); }
.proto-body {
  width: min(300px, calc(100vw - 32px));
  max-height: min(70dvh, 560px); overflow: auto;
  display: grid; gap: 10px; padding: 16px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
}
.proto-label { font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 4px; }
.proto-body p { color: var(--fg-2); }
.proto-body select { height: 34px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: var(--r-control); background: var(--surface); }
.proto-links { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.proto-links a { padding: 6px 8px; border-radius: 6px; color: var(--fg); font-size: 13px; background: var(--surface-sunken); }
.proto-links a:hover { text-decoration: none; background: var(--surface-soft); }
.proto-left { right: auto; left: 16px; align-items: flex-start; }
.creds { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cred { display: grid; gap: 2px; padding: 8px 10px; border-radius: 8px; background: var(--surface-sunken); border: 1px solid var(--border); }
.cred-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.cred-top strong { font-weight: 500; }
.cred-copy { justify-self: start; max-width: 100%; padding: 1px 4px; margin-left: -4px; border: 0; border-radius: 4px; background: none; font: 500 12.5px/1.5 var(--mono); color: var(--fg); text-align: left; overflow-wrap: anywhere; cursor: copy; }
.cred-copy:hover { background: var(--surface-soft); }

/* ───────── Responsive ───────── */
@media (max-width: 1080px) {
  .auth-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr); }
}
@media (max-width: 860px) {
  /* Phones / small tablets: form only — the brand artwork is hidden */
  .auth-layout { grid-template-columns: 1fr; }
  .art { display: none; }
  .auth-main { padding: 36px 20px 48px; align-items: flex-start; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .auth-main { padding: 28px 18px 88px; }
  .screen-head h1 { font-size: 28px; }
  .app-bar { padding: 0 16px; }
  .app-user-text { display: none; }
  .app-main { padding: 32px 16px 96px; }
  .page-head h1 { font-size: 28px; }
  .session { flex-wrap: wrap; padding: 16px; }
  .session-info { flex-basis: calc(100% - 64px); }
  .session .btn { margin-left: 64px; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .btn.is-loading::before { animation: spin 1.4s linear infinite !important; }
}

/* ───────── Compact density — the approved scale, on every page ─────────
   Every <body> carries `compact`. These rules override the larger base sizes above;
   ponytail: kept as an override layer for now — fold into the base tokens once the design settles. */
.compact { --control-h: 42px; --r-control: 8px; }
/* Centred, but the extra bottom padding lifts the column slightly above the middle */
.compact .auth-main { align-items: center; padding: 48px 24px clamp(48px, calc(16vh - 44px), 116px); }
.compact .auth-col { width: min(100%, 380px); }
.compact .screen { gap: 24px; }
.compact .screen-head { gap: 6px; }
.compact .screen-head h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.025em; }
.compact .screen-head p { font-size: 15px; }
.compact .kicker { font-size: 12.5px; padding: 3px 10px; }
.compact .status-icon { width: 52px; height: 52px; border-radius: 14px; }
.compact .status-icon svg.lucide { width: 24px; height: 24px; }
.compact form, .compact .form-body { gap: 18px; }
.compact .field { gap: 7px; }
.compact .label { font-size: 14px; font-weight: 500; }
.compact .input { padding: 0 12px; font-size: 15px; }
.compact textarea.input { height: auto; padding: 10px 12px; font-family: inherit; line-height: 1.5; } /* multi-line: keep vertical padding the single-line rule above strips */
.compact .control .input:has(+ .reveal) { padding-right: 46px; }
.compact .reveal { right: 4px; width: 36px; height: 34px; }
.compact svg.lucide { width: 18px; height: 18px; }
.compact .field-error { font-size: 13.5px; }
.compact .field-error svg.lucide { width: 15px; height: 15px; }
.compact .strength-bars span { height: 4px; }
.compact .strength-text { font-size: 13px; }
.compact .reqs { padding: 12px 14px; gap: 7px; font-size: 13.5px; }
.compact .reqs li svg.lucide { width: 16px; height: 16px; }
.compact .details > div { padding: 11px 14px; font-size: 14px; }
.compact .alert { padding: 12px 14px; font-size: 14px; }
.compact .foot, .compact .switch-row { font-size: 14px; }
.foot-links { display: grid; gap: 6px; text-align: center; color: var(--muted); font-size: 14px; }
.legal { margin-top: 4px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.6; }
.legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--border-strong); }
.legal a:hover { color: var(--fg); }

/* Secondary links — one style everywhere: dark text, medium weight (like the button label),
   subtle underline (like the legal line). Covers footer links, Change / Resend / Use password,
   "Forgot password?" next to the field, and Back to sign in. */
.compact .foot a, .compact .foot-links a, .compact .switch-row .link-btn, .compact .foot .link-btn,
.compact .screen-head .link-btn, .compact .field-row a, .compact .back-link {
  color: var(--fg); font-weight: 500;
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-thickness: 1px; text-decoration-color: var(--border-strong);
}
.compact .foot a:hover, .compact .foot-links a:hover, .compact .link-btn:hover:not(:disabled),
.compact .field-row a:hover, .compact .back-link:hover { text-decoration-color: currentColor; }
.compact .link-btn:disabled { color: var(--muted); text-decoration: none; }
.compact .field-row a, .compact .back-link { font-size: 14px; }
.compact .back-link svg.lucide { width: 16px; height: 16px; }
.compact .otp { gap: 8px; }
.compact .otp .input { height: 48px; font-size: 20px; }
.compact .brand { font-size: 18px; }
.compact .mark { width: 26px; height: 26px; }

/* Button — first-iteration glossy black (no sheen layer, no lift) */
.compact .btn { padding: 0 18px; font-size: 15px; }
.compact .btn::after { display: none; }
.compact .btn:hover:not(:disabled) { transform: none; }
.compact .btn-primary {
  background: linear-gradient(180deg, #ff7d47 0%, var(--brand) 55%, #e94a0f 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.28), inset 0 -1px 0 rgb(120 30 0 / 0.35), 0 1px 2px rgb(150 50 10 / 0.25), 0 6px 14px -8px rgb(200 70 20 / 0.6);
}
.compact .btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #ff9161 0%, #ff6a30 55%, #f0531a 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.32), inset 0 -1px 0 rgb(120 30 0 / 0.35), 0 1px 2px rgb(150 50 10 / 0.25), 0 6px 14px -8px rgb(200 70 20 / 0.6);
}
.compact .btn-primary:active:not(:disabled) {
  background: linear-gradient(180deg, #e14a12 0%, #f0561c 100%);
  box-shadow: inset 0 2px 4px rgb(120 30 0 / 0.35);
}
.compact .btn-secondary { background: var(--surface-soft); box-shadow: none; }
.compact .btn-secondary:hover:not(:disabled) { background: #e8e8e7; box-shadow: none; }
.compact .btn-outline, .compact .btn-danger-quiet { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border-strong); }
.compact .btn-outline:hover:not(:disabled) { background: var(--surface-sunken); box-shadow: inset 0 0 0 1px var(--border-strong); }
.compact .btn-danger-quiet:hover:not(:disabled) { background: var(--danger-bg); box-shadow: inset 0 0 0 1px var(--danger-line); }

/* Signed-in pages (home, devices) at the same scale */
.compact .app-bar { height: 60px; padding: 0 24px; }
.compact .avatar { width: 34px; height: 34px; font-size: 13px; }
.compact .app-user-name { font-size: 14px; }
.compact .app-user-role { font-size: 12.5px; }
.compact .app-main { width: min(1600px, 100%); padding: 48px 32px 96px; }
.compact .page { gap: 24px; }
.compact .page-head h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.025em; }
.compact .page-head p { font-size: 15px; }
.compact .crumbs { font-size: 13.5px; }
.compact .crumbs svg.lucide { width: 14px; height: 14px; }
.compact .card-pad { padding: 20px; gap: 14px; }
.compact .card h2 { font-size: 21px; font-weight: 700; }
.compact .card p, .compact .link-card span { font-size: 14px; }
.compact .link-card { padding: 18px 20px; }
.compact .tile { width: 40px; height: 40px; border-radius: 10px; }
.compact .session { padding: 16px 20px; gap: 14px; }
.compact .session-meta { font-size: 13.5px; }
.compact .badge { height: 22px; font-size: 12px; padding: 0 8px; }
.compact .empty-row { padding: 16px 20px; font-size: 14px; }
.compact dialog.modal { width: min(420px, calc(100% - 32px)); }
.compact .modal-body h2 { font-size: 24px; font-weight: 700; }
.compact .modal-body p { font-size: 14.5px; }
.compact .toast { padding: 11px 16px; font-size: 14px; }

@media (max-width: 860px) {
  .compact .auth-main { align-items: flex-start; padding: 32px 20px 48px; }
  .compact .screen-head h1 { font-size: 28px; }
  .compact .page-head h1 { font-size: 28px; }
}

.compact .divider { margin: 6px 0; font-size: 12.5px; font-weight: 500; letter-spacing: 0.08em; }
/* Outlined secondary (Decline, Log out…) — white, light hairline, like the reference SSO buttons */
.compact .btn-outline { box-shadow: inset 0 0 0 1px #dcdedd; }
.compact .btn-outline:hover:not(:disabled) { background: var(--surface-sunken); box-shadow: inset 0 0 0 1px #c9cccb; }

/* Social / SSO row (sign-in, sign-up): three providers, SSO full width — mirrors the reference */
.social { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.social .social-wide { grid-column: 1 / -1; }
.social .btn { gap: 8px; padding: 0 10px; }
.social svg:not(.lucide) { width: 18px; height: 18px; flex: none; }
.compact .screen > .divider { margin: -6px 0; }

/* Brand logo — top-left of the form column on every auth page */
.auth-main { position: relative; }
.auth-logo { position: absolute; top: 28px; left: 32px; display: inline-flex; border-radius: 6px; }
.auth-logo img { display: block; height: 32px; width: auto; }
.compact .mark { width: auto; height: 26px; } /* signed-in top bar uses the same logo */
@media (max-width: 860px) {
  .auth-logo { top: 24px; left: 20px; }
  .compact .auth-main { padding-top: 84px; } /* clear the logo */
}
