/* Matches the PODVIEW sign-in card in its dark theme: near-black page, dark card, red primary. */
:root {
  --background: hsl(0 0% 5%);
  --foreground: hsl(0 0% 96%);
  --card: hsl(0 0% 10%);
  --card-border: hsl(0 0% 17%);
  --input: hsl(0 0% 23%);
  --muted: hsl(0 0% 53%);
  --primary: hsl(0 100% 65%);
  --primary-hover: hsl(0 100% 60%);
  --destructive: hsl(0 84% 60%);
  --radius: 0.5rem;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: var(--background);
  color: var(--foreground);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.card {
  width: 100%;
  max-width: 400px;
  padding: 32px 24px 24px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.35);
}

.brand { display: flex; align-items: center; justify-content: center; gap: 10px; }
.brand-icon { width: 36px; height: 36px; object-fit: contain; }
.brand-wordmark { height: 22px; width: auto; object-fit: contain; }

.intro { margin: 16px 0 24px; text-align: center; font-size: 14px; color: var(--muted); }

label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; }
.required { color: var(--destructive); }

.field { position: relative; }
.field-icon {
  position: absolute; left: 12px; top: 0; bottom: 0; margin: auto;
  width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

input {
  width: 100%;
  height: 44px;
  padding: 0 12px 0 36px;
  background: transparent;
  color: var(--foreground);
  border: 1px solid var(--input);
  border-radius: var(--radius);
  font: inherit;
  font-size: 16px; /* 16px or more stops iOS zooming in on focus */
}
input::placeholder { color: var(--muted); }
input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px hsl(0 100% 65% / 0.35); }
input:disabled { opacity: 0.6; }

.turnstile { display: flex; justify-content: center; margin-top: 12px; }
.turnstile:empty { margin-top: 0; }

.status { min-height: 21px; margin: 12px 0; text-align: center; font-size: 14px; color: var(--muted); }
.status.error { color: var(--destructive); }

button {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button:hover:not(:disabled) { background: var(--primary-hover); }
button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
button:disabled { opacity: 0.6; cursor: default; }

button.link {
  margin-top: 8px;
  height: auto;
  padding: 8px;
  background: none;
  color: var(--primary);
  font-weight: 500;
}
button.link:hover:not(:disabled) { background: none; text-decoration: underline; }

.continuing { margin-top: 16px; text-align: center; }
.continuing .status { margin: 16px 0 8px; color: var(--foreground); }
a.link { display: inline-block; padding: 8px; color: var(--primary); font-size: 14px; font-weight: 500; text-decoration: none; }
a.link:hover { text-decoration: underline; }
a.link:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.noscript { text-align: center; color: var(--muted); }

@media (max-width: 420px) {
  .card { padding: 28px 20px 20px; border-radius: var(--radius); }
}

.who { margin: 0 0 12px; color: #b9b9b9; font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: baseline; }
.hint { margin: 4px 0 0; color: #8a8a8a; font-size: 12px; }
.choices { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.choices button { width: 100%; text-align: left; display: flex; justify-content: space-between; align-items: center; }
.choices .host { color: #9a9a9a; font-size: 12px; font-weight: 400; }
.actions { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; }
.actions button:not(.link) { flex: 1 1 auto; }

/* ── Workspace chooser and "Opening <workspace>…" (design B: split hero on wide screens, hero and
   sheet on narrow ones, a search screen and an opening screen on phones). Dark only, like the page. */
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/fonts/sora-latin.woff2") format("woff2");
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/dm-sans-latin.woff2") format("woff2");
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

body.ws-page { display: block; padding: 0; background: #0a0a0a; }

.ws, .ws-opening {
  --ws-red: #dc2626;
  --ws-link: #f87171;
  --ws-line: rgb(255 255 255 / 0.08);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #fff;
}
.ws h1, .ws h2, .ws p, .ws ul, .ws-opening h1, .ws-opening p { margin: 0; }
.ws svg, .ws-opening svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.ws-brand { display: flex; align-items: center; gap: 10px; }
.ws-brand-icon { width: 30px; height: 30px; object-fit: contain; }
.ws-brand-wordmark { height: 18px; width: auto; }

.ws-eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; color: var(--ws-link); }
.ws-title { font-family: Sora, sans-serif; font-size: 56px; line-height: 1.05; font-weight: 700; letter-spacing: -2px; }
.grad { background: linear-gradient(90deg, #ef4444, #f97316); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ws-lede { font-family: Sora, sans-serif; font-weight: 300; font-size: 18px; line-height: 1.5; color: rgb(255 255 255 / 0.6); }
.ws-narrow { display: none; }

.ws-chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.ws-chips li {
  font-size: 12px; font-weight: 500; color: rgb(255 255 255 / 0.7);
  border: 1px solid rgb(255 255 255 / 0.12); padding: 6px 12px; border-radius: 999px;
}

/* Wide: the split hero. */
.ws { min-height: 100vh; display: flex; background: #0a0a0a; }
.ws-hero {
  flex: 1 1 520px; min-width: 0; position: sticky; top: 0; height: 100vh; min-height: 560px;
  padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
  background: radial-gradient(ellipse 90% 70% at 0% 100%, rgb(220 38 38 / 0.22), rgb(10 10 10 / 0) 65%), #0a0a0a;
  border-right: 1px solid rgb(255 255 255 / 0.06);
}
.ws-intro { display: flex; flex-direction: column; gap: 20px; max-width: 520px; }

.ws-panel {
  flex: 1 1 440px; min-width: 0; padding: 56px; display: flex; flex-direction: column; justify-content: center; gap: 24px;
  background: #0f0f10;
}
.ws-head { display: flex; flex-direction: column; gap: 6px; }
.ws-head h2 { font-family: Sora, sans-serif; font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.ws-head h2:focus, .ws-opening h1:focus { outline: none; }
.ws-email { font-size: 14px; color: rgb(255 255 255 / 0.6); overflow-wrap: anywhere; }

.ws-search { display: flex; align-items: center; gap: 8px; }
.ws-field {
  flex: 1; min-width: 0; margin: 0; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px;
  border-radius: 999px; background: rgb(255 255 255 / 0.04); border: 1px solid rgb(255 255 255 / 0.1);
  font-weight: 400; cursor: text;
}
.ws-field > svg { width: 18px; height: 18px; flex: none; color: rgb(255 255 255 / 0.6); }
.ws-field:focus-within {
  background: rgb(255 255 255 / 0.05); border-color: rgb(220 38 38 / 0.55); box-shadow: 0 0 0 4px rgb(220 38 38 / 0.12);
}
.ws-field:focus-within > svg { color: #ef4444; }
.ws-field input {
  flex: 1; min-width: 0; height: auto; padding: 0; border: 0; border-radius: 0; background: transparent;
  color: #fff; font: inherit; font-size: 15px; box-shadow: none; -webkit-appearance: none; appearance: none;
}
.ws-field input:focus { outline: none; box-shadow: none; }
.ws-field input::placeholder { color: rgb(255 255 255 / 0.6); }
.ws-field input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }

.ws button { width: auto; height: auto; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; color: inherit; font: inherit; }
.ws button:hover:not(:disabled) { background: none; }
.ws-clear {
  width: 28px !important; height: 28px !important; flex: none; border-radius: 999px !important;
  background: rgb(255 255 255 / 0.12) !important; display: flex; align-items: center; justify-content: center;
}
.ws-clear svg { width: 14px; height: 14px; stroke-width: 2.4; }
.ws-back { display: none; width: 44px !important; height: 44px !important; flex: none; border-radius: 999px !important; align-items: center; justify-content: center; }
.ws-back svg { width: 22px; height: 22px; }

.ws-count:not(:empty) { font-size: 12px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; color: rgb(255 255 255 / 0.55); }
.ws[data-mode="list"] .ws-count, .ws-count { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ws-list {
  list-style: none; padding: 0; display: flex; flex-direction: column;
  border-radius: 16px; border: 1px solid var(--ws-line); overflow: hidden;
}
/* The last row's divider tucks under the list's own border. */
.ws-list li { margin-bottom: -1px; }
.ws-row {
  width: 100% !important; display: flex !important; align-items: center; gap: 14px; padding: 16px 18px !important;
  text-align: left; color: #fff; cursor: pointer;
  background: rgb(255 255 255 / 0.02) !important; border-bottom: 1px solid rgb(255 255 255 / 0.06) !important;
  transition: background 0.15s;
}
.ws-row:hover, .ws-row:active { background: rgb(255 255 255 / 0.05) !important; }
.ws-row:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.ws-avatar {
  width: 40px; height: 40px; flex: none; border-radius: 999px; background: rgb(255 255 255 / 0.08);
  display: flex; align-items: center; justify-content: center;
  font-family: Sora, sans-serif; font-weight: 700; font-size: 14px;
}
.ws-row.is-last .ws-avatar { background: var(--ws-red); }
.ws-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ws-name { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.ws-meta { font-size: 13px; color: rgb(255 255 255 / 0.55); overflow-wrap: anywhere; }
.ws-go {
  flex: none; font-size: 13px; font-weight: 600; padding: 9px 16px; border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.18); color: rgb(255 255 255 / 0.85); transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ws-row:hover .ws-go, .ws-row:focus-visible .ws-go { background: var(--ws-red); color: #fff; border-color: var(--ws-red); }
.ws-chevron { display: none; width: 18px; height: 18px; flex: none; color: rgb(255 255 255 / 0.6); }

.ws-empty {
  padding: 32px 16px; border-radius: 16px; border: 1px dashed rgb(255 255 255 / 0.16);
  text-align: center; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: rgb(255 255 255 / 0.6);
}
.ws-empty-title { font-family: Sora, sans-serif; font-weight: 600; font-size: 16px; color: #fff; overflow-wrap: anywhere; }

.ws .status { margin: 0; min-height: 0; }
.ws .status:empty { display: none; }

.ws-actions { display: flex; gap: 24px; font-size: 14px; }
.ws-link {
  display: inline-block; padding: 10px 0 !important; color: var(--ws-link) !important; font-size: 14px !important;
  font-weight: 500 !important; text-decoration: none; cursor: pointer;
}
.ws-link:hover { color: #fca5a5 !important; }
.ws-link-quiet { color: rgb(255 255 255 / 0.7) !important; }
.ws-link:focus-visible, .ws-back:focus-visible, .ws-clear:focus-visible, .ws-ghost:focus-visible {
  outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px;
}

/* Narrow: hero on top, the list in a sheet below. */
@media (max-width: 899px) {
  .ws {
    min-height: 100vh; min-height: 100dvh; flex-direction: column;
    background: radial-gradient(ellipse 120% 55% at 0% 0%, rgb(220 38 38 / 0.26), rgb(10 10 10 / 0) 70%), #0a0a0a;
  }
  .ws-hero, .ws-panel { padding-inline: max(24px, calc((100% - 600px) / 2)); }
  .ws-hero {
    flex: none; position: static; height: auto; min-height: 0; justify-content: flex-start; gap: 22px;
    padding-top: max(56px, calc(env(safe-area-inset-top) + 24px)); padding-bottom: 28px;
    background: none; border-right: 0;
  }
  .ws-brand { gap: 8px; }
  .ws-brand-icon { width: 26px; height: 26px; }
  .ws-brand-wordmark { height: 15px; }
  .ws-intro { gap: 12px; }
  .ws-eyebrow { font-size: 12px; letter-spacing: 1.4px; }
  .ws-title { font-size: 34px; line-height: 1.08; letter-spacing: -1.4px; }
  .ws-lede { font-size: 15px; }
  .ws-wide { display: none; }
  .ws-narrow { display: inline; }
  .ws-chips { display: none; }

  .ws-panel {
    flex: 1; justify-content: flex-start; gap: 16px;
    padding-top: 24px; padding-bottom: max(28px, calc(env(safe-area-inset-bottom) + 12px));
    padding-inline: max(20px, calc((100% - 600px) / 2));
    border-radius: 28px 28px 0 0; border-top: 1px solid var(--ws-line);
  }
  .ws-head { flex-direction: row; justify-content: space-between; align-items: baseline; gap: 12px; }
  .ws-head h2 { font-size: 18px; letter-spacing: -0.4px; flex: none; }
  .ws-email { font-size: 12px; color: rgb(255 255 255 / 0.55); text-align: right; min-width: 0; }
  .ws-field input { font-size: 16px; } /* 16px or more stops iOS zooming in on focus */
  .ws-list { border-radius: 18px; }
  .ws-row { gap: 12px; padding: 14px !important; min-height: 72px; }
  .ws-meta { font-size: 12px; }
  .ws-go { padding: 9px 14px; }
  .ws-row.is-last .ws-go { background: var(--ws-red); border-color: var(--ws-red); color: #fff; }
  .ws-actions { margin-top: auto; justify-content: space-between; align-items: center; gap: 12px; }
  .ws-link { padding: 12px 0 !important; }

  /* The search screen: a header with back and the field, then the matches as separate cards. */
  .ws[data-mode="search"] { background: #0f0f10; }
  .ws[data-mode="search"] .ws-hero, .ws[data-mode="search"] .ws-head, .ws[data-mode="search"] .ws-actions { display: none; }
  .ws[data-mode="search"] .ws-panel { padding: 0 0 max(28px, env(safe-area-inset-bottom)); gap: 14px; border: 0; border-radius: 0; }
  .ws[data-mode="search"] .ws-panel > :not(.ws-search) { margin-inline: max(20px, calc((100% - 600px) / 2)); }
  .ws[data-mode="search"] .ws-search {
    padding: max(52px, calc(env(safe-area-inset-top) + 20px)) max(16px, calc((100% - 632px) / 2)) 16px;
    border-bottom: 1px solid var(--ws-line);
    background: radial-gradient(ellipse 100% 120% at 0% 0%, rgb(220 38 38 / 0.18), rgb(15 15 16 / 0) 70%);
  }
  .ws[data-mode="search"] .ws-back { display: flex; }
  .ws[data-mode="search"] .ws-field { padding: 0 14px; }
  .ws[data-mode="search"] .ws-count { position: static; width: auto; height: auto; overflow: visible; clip: auto; margin-top: 6px; }
  .ws[data-mode="search"] .ws-list { border: 0; border-radius: 0; overflow: visible; gap: 10px; }
  .ws[data-mode="search"] .ws-list li { margin-bottom: 0; }
  .ws[data-mode="search"] .ws-row {
    border-radius: 16px !important; background: rgb(255 255 255 / 0.03) !important; border: 1px solid var(--ws-line) !important;
  }
  .ws[data-mode="search"] .ws-row:active { background: rgb(255 255 255 / 0.05) !important; }
  .ws[data-mode="search"] .ws-go { display: none; }
  .ws[data-mode="search"] .ws-chevron { display: block; }
}
@media (min-width: 600px) and (max-width: 899px) {
  .ws-title { font-size: 44px; letter-spacing: -1.8px; }
}

/* Opening a workspace. */
.ws-opening {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: space-between; align-items: center;
  padding: max(56px, calc(env(safe-area-inset-top) + 24px)) 24px max(32px, calc(env(safe-area-inset-bottom) + 16px));
  background: radial-gradient(circle at 50% 44%, rgb(220 38 38 / 0.24), rgb(10 10 10 / 0) 55%), #0a0a0a;
}
.ws-opening .ws-brand { justify-content: center; gap: 8px; }
.ws-opening .ws-brand-icon { width: 24px; height: 24px; }
.ws-opening .ws-brand-wordmark { height: 14px; }
.ws-opening-body { display: flex; flex-direction: column; align-items: center; gap: 24px; text-align: center; max-width: 100%; }
.ws-opening-avatar {
  width: 88px; height: 88px; border-radius: 999px; background: rgb(255 255 255 / 0.06); border: 1px solid rgb(220 38 38 / 0.5);
  display: flex; align-items: center; justify-content: center; font-family: Sora, sans-serif; font-weight: 700; font-size: 30px;
  animation: ws-pulse 2s ease-in-out infinite;
}
.ws-opening-text { display: flex; flex-direction: column; gap: 8px; }
.ws-opening-text .ws-eyebrow { font-size: 12px; letter-spacing: 1.4px; }
.ws-opening h1 { font-family: Sora, sans-serif; font-size: 28px; line-height: 1.1; font-weight: 700; letter-spacing: -1px; overflow-wrap: anywhere; }
.ws-opening-host { font-size: 14px; color: rgb(255 255 255 / 0.6); }
.ws-progress { width: 220px; height: 4px; border-radius: 999px; background: rgb(255 255 255 / 0.08); overflow: hidden; }
.ws-progress > div {
  height: 100%; width: 60%; border-radius: 999px; background: linear-gradient(90deg, #dc2626, #f97316);
  animation: ws-load 2.4s ease-out infinite;
}
.ws-opening-note { font-size: 13px; color: rgb(255 255 255 / 0.6); }
.ws-opening-foot { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 10px; }
.ws-ghost {
  height: 52px; border-radius: 999px; border: 1px solid rgb(255 255 255 / 0.14); background: none; color: #fff;
  font: inherit; font-weight: 600; font-size: 15px;
}
.ws-ghost:hover:not(:disabled) { background: rgb(255 255 255 / 0.05); }
.ws-opening-who { text-align: center; font-size: 12px; color: rgb(255 255 255 / 0.55); overflow-wrap: anywhere; }

@keyframes ws-load { 0% { width: 8%; } 70% { width: 82%; } 100% { width: 96%; } }
@keyframes ws-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgb(220 38 38 / 0.35); }
  50% { box-shadow: 0 0 0 18px rgb(220 38 38 / 0); }
}

@media (prefers-reduced-motion: reduce) {
  .ws-opening-avatar, .ws-progress > div { animation: none; }
  .ws-row, .ws-go { transition: none; }
}

/* Two-step verification: the verify step, enrolment and the Security page (public/mfa.js). */
.check { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-weight: 400; font-size: 14px; color: #d0d0d0; }
.check input { width: auto; margin: 0; }
.mfa-or { text-align: center; margin: 12px 0; }
#mfa-code-block, #enrol-choose button, #enrol-totp button { margin-top: 12px; }
#enrol-choose button { width: 100%; }
#enrol-app { background: transparent; border: 1px solid #3a3a3a; }
.mfa-qr { display: block; width: 184px; height: 184px; margin: 12px auto; background: #fff; border-radius: 8px; padding: 8px; }
.mfa-secret, .codes { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 20px; margin: 12px 0; padding-left: 22px; font-size: 15px; letter-spacing: 1px; }
.sec-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid #262626; }
.sec-row .hint { margin: 2px 0 0; }
.sec-name, .sec-head { margin: 0; font-size: 14px; font-weight: 500; }
.sec-head { margin-top: 16px; padding-top: 12px; border-top: 1px solid #262626; display: flex; gap: 8px; align-items: center; }
.sec-pill { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 8px; background: #262626; color: #cfcfcf; }
.sec-pill.on { background: hsl(142 70% 45% / 0.18); color: #4ade80; }
.sec-buttons { display: flex; gap: 12px; }
.sec-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sec-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: #cfcfcf; }
.sec-list .hint { display: block; }
#security-back { margin-top: 8px; width: 100%; }
.ws-note { margin-top: 8px; font-size: 13px; color: #fbbf24; }
.ws-note a { color: inherit; }
#mfa-code, #enrol-code, #enrol-passkey-name { padding-left: 12px; }
#mfa-code, #enrol-code { letter-spacing: 3px; }
.check input { height: 16px; width: 16px; padding: 0; }
a.link { color: var(--foreground); font-size: 14px; text-decoration: underline; cursor: pointer; }
.sec-row button.link, .sec-list button.link, .sec-buttons button.link { width: auto; margin: 0; padding: 4px 6px; font-size: 14px; }
