/* The Korps account portal.
 *
 * Not the workforce. The workforce is run from the Korps app; this is where a
 * person manages the account behind it: the plan, the money, what has been
 * used, which devices are signed in, and the security of the account itself.
 * Six areas, one focused page each, and enough room to read.
 *
 * Same tokens as the site, deliberately: someone arriving from korps.ai should
 * not feel they have been handed to a different company's admin tool.
 */

:root {
  --ground-deep: #0B0C0F;
  --ground: #101217;
  --panel: #161920;
  --raised: #1D2129;
  --border: #1A1E26;
  --border-strong: #262B35;
  --text: #F2EFE8;
  --text-2: #B8B4AB;
  --text-3: #8B8981;
  --gold: #E2A93B;
  --gold-hover: #F0BC58;
  --gold-deep: #8A6420;
  --ok: #39C173;
  --warn: #E2A93B;
  --bad: #E5484D;
  --bad-text: #F2646A;
  --info: #4C8DFF;
  --display: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --rail: 260px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--ground-deep);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hover); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 60;
  background: var(--gold); color: #14100A; padding: .7rem 1.1rem; font-weight: 600;
}
.skip:focus { left: 1rem; top: 1rem; }

h1, h2, h3 { font-family: var(--display); font-weight: 580; letter-spacing: -0.022em; margin: 0; }
h1 { font-size: 30px; line-height: 1.12; }
h2 { font-size: 20px; line-height: 1.2; }
h3 { font-size: 16px; line-height: 1.3; }
p { margin: 0; }
.muted { color: var(--text-2); }
.quiet { color: var(--text-3); font-size: 14px; }

/* ---- The shell: a rail, and one page ------------------------------------ */

.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }

.rail {
  position: sticky; top: 0; align-self: start; height: 100vh;
  display: flex; flex-direction: column; gap: 26px;
  padding: 26px 18px 20px;
  background: var(--ground);
  border-right: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; min-height: 40px; color: var(--text); }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand .name { font-family: var(--display); font-size: 17px; letter-spacing: -0.02em; font-weight: 580; }
.brand .kind { color: var(--text-3); font-size: 12px; letter-spacing: .09em; text-transform: uppercase; display: block; margin-top: -3px; }

nav.areas { display: flex; flex-direction: column; gap: 2px; }
nav.areas button {
  display: flex; align-items: center; justify-content: flex-start; gap: 11px;
  width: 100%; min-height: 44px; padding: 0 12px;
  background: none; border: 0; border-radius: 9px;
  color: var(--text-2); font: inherit; font-size: 15px; text-align: left; cursor: pointer;
  transition: background 160ms var(--ease-out), color 160ms var(--ease-out);
}
nav.areas button:hover { background: var(--panel); color: var(--text); }
nav.areas button.on { background: var(--raised); color: var(--text); }
nav.areas button.on .dot { background: var(--gold); }
nav.areas .dot { width: 6px; height: 6px; border-radius: 50%; background: transparent; flex: none; }
nav.areas .count {
  margin-left: auto; font-size: 12px; color: var(--ground-deep);
  background: var(--gold); border-radius: 999px; padding: 1px 7px; font-weight: 600;
}

.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 8px; }
.plan-chip {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--panel);
}
.plan-chip b { font-size: 14px; font-weight: 600; }
.who-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.who-line span { font-size: 13px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.who-line button { white-space: nowrap; flex: none; min-height: 44px; padding: 0 10px; font-size: 13.5px; }

main.page { padding: 40px clamp(20px, 4vw, 56px) 96px; max-width: 1080px; }
.page-head { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: baseline; margin-bottom: 8px; }
.page-head p { color: var(--text-2); font-size: 15px; }
.section { margin-top: 40px; }
.section > h2 { margin-bottom: 14px; }

/* ---- Cards, facts, tables ------------------------------------------------ */

.card {
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: 14px;
  padding: 22px 24px;
}
.card + .card { margin-top: 14px; }
.card h3 { margin-bottom: 4px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .label { color: var(--text-3); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.stat .value { font-family: var(--display); font-size: 32px; line-height: 1.05; letter-spacing: -0.03em; }
.stat .value.small { font-size: 22px; }
.stat .note { color: var(--text-2); font-size: 14px; }

dl.facts { display: grid; grid-template-columns: minmax(140px, auto) 1fr; gap: 10px 20px; margin: 0; }
dl.facts dt { color: var(--text-3); font-size: 14px; }
dl.facts dd { margin: 0; font-size: 15px; }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-weight: 600; color: var(--text-3); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; padding: 0 12px 10px 0; }
td { padding: 12px 12px 12px 0; border-top: 1px solid var(--border); vertical-align: top; }
td.num, th.num { text-align: right; padding-right: 0; font-variant-numeric: tabular-nums; }
.scroller { overflow-x: auto; }

.bar-line { display: grid; gap: 6px; }
.bar-track { height: 8px; border-radius: 999px; background: var(--raised); overflow: hidden; }
.bar-fill { height: 100%; background: var(--gold); border-radius: 999px; transition: width 500ms var(--ease-out); }
.bar-fill.ok { background: var(--ok); }
.bar-fill.warn { background: var(--warn); }
.bar-fill.bad { background: var(--bad); }

.split { display: grid; gap: 10px; }
.split .row { display: flex; align-items: center; gap: 12px; }
.split .swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.split .row .amount { margin-left: auto; font-variant-numeric: tabular-nums; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--text-2); background: var(--raised);
}
.pill.ok { color: var(--ok); border-color: rgba(57, 193, 115, .35); }
.pill.warn { color: var(--warn); border-color: rgba(226, 169, 59, .35); }
.pill.bad { color: var(--bad-text); border-color: rgba(229, 72, 77, .38); }

/* ---- Buttons and forms --------------------------------------------------- */

button, .btn {
  font: inherit; font-size: 15px; min-height: 44px; padding: 0 18px;
  border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--raised); color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 160ms var(--ease-out), border-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
button:hover, .btn:hover { border-color: #333A46; background: #232833; color: var(--text); }
button.primary, .btn.primary {
  background: var(--gold); border-color: var(--gold); color: #14100A; font-weight: 600;
}
button.primary:hover, .btn.primary:hover { background: var(--gold-hover); border-color: var(--gold-hover); color: #14100A; }
button.ghost { background: none; border-color: transparent; color: var(--text-2); padding: 0 10px; }
button.ghost:hover { background: var(--panel); color: var(--text); }
button.danger { color: var(--bad-text); border-color: rgba(229, 72, 77, .35); background: none; }
button.danger:hover { background: rgba(229, 72, 77, .1); border-color: rgba(229, 72, 77, .55); }
button[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

label { display: block; font-size: 14px; color: var(--text-2); margin-bottom: 6px; }
input, select {
  font: inherit; font-size: 15px; width: 100%; min-height: 46px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--ground); color: var(--text);
}
input:hover, select:hover { border-color: #333A46; }
input::placeholder { color: var(--text-3); }
form.stack { display: grid; gap: 16px; }
.field-note { color: var(--text-3); font-size: 13px; margin-top: 6px; }

/* ---- Notices ------------------------------------------------------------- */

.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: 12px; font-size: 15px;
  border: 1px solid var(--border-strong); background: var(--panel); color: var(--text);
  margin-bottom: 18px;
}
.notice.error { border-color: rgba(229, 72, 77, .4); background: rgba(229, 72, 77, .08); }
.notice.ok { border-color: rgba(57, 193, 115, .4); background: rgba(57, 193, 115, .07); }
.notice .close { margin-left: auto; }
.notice-list { display: grid; gap: 10px; }

.empty {
  border: 1px dashed var(--border-strong); border-radius: 12px;
  padding: 28px 24px; text-align: center; color: var(--text-2);
}
.empty h3 { color: var(--text); margin-bottom: 6px; }

/* ---- Plan ladder --------------------------------------------------------- */

.ladder { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tier {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: 14px; padding: 20px;
}
.tier.current { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(226, 169, 59, .25); }
.tier .price { font-family: var(--display); font-size: 26px; letter-spacing: -0.03em; }
.tier .price small { font-family: var(--sans); font-size: 14px; color: var(--text-3); letter-spacing: 0; }
.tier ul { margin: 4px 0 0; padding-left: 18px; color: var(--text-2); font-size: 14.5px; }
.tier li { margin-bottom: 4px; }
.tier .foot { margin-top: auto; padding-top: 14px; }
.tier .foot button { width: 100%; }

.steps { display: grid; gap: 12px; }
.step { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.step .mark {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--border-strong); color: var(--text-3); font-size: 13px;
}
.step.done .mark { border-color: var(--ok); color: var(--ok); }

/* ---- Devices ------------------------------------------------------------- */

.device { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--border); }
.device:first-child { border-top: 0; }
.device .icon {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--raised); border: 1px solid var(--border-strong); flex: none;
}
.device .icon svg { width: 18px; height: 18px; }
.device .meta { min-width: 0; }
.device .meta b { font-weight: 600; font-size: 15px; }
.device .meta div { color: var(--text-3); font-size: 13.5px; }
.device .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ---- Sign in ------------------------------------------------------------- */

.auth { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: min(100%, 420px); display: grid; gap: 22px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.auth-brand .mark { display: block; }
.auth-brand .mark svg { width: 44px; height: 44px; display: block; }
.auth-brand h1 { font-size: 26px; }
.auth-brand p { color: var(--text-2); font-size: 15px; }
.auth-panel { background: var(--panel); border: 1px solid var(--border-strong); border-radius: 16px; padding: 26px 24px; }
.auth-switch { text-align: center; color: var(--text-2); font-size: 14.5px; }
.auth-switch button { min-height: 34px; padding: 0 6px; background: none; border: 0; color: var(--gold); }
.auth-switch button:hover { background: none; color: var(--gold-hover); }
.auth-legal { text-align: center; color: var(--text-3); font-size: 13px; }
.auth-legal a { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0; }
.codes code {
  background: var(--ground); border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 8px 10px; font-size: 14px; text-align: center; letter-spacing: .04em;
}

/* ---- Inline validation ---------------------------------------------------
 * A message about one field, next to that field, in the page's own voice. The
 * browser's native bubble said "Please fill out this field" in the browser's
 * words, outside this styling, and disappeared on the next keystroke.
 */

.field-error { color: var(--bad-text); font-size: 13.5px; margin-top: 6px; min-height: 0; }
.field-error:empty { display: none; }
input.bad, input[aria-invalid='true'] { border-color: var(--bad); }
input.bad:focus, input[aria-invalid='true']:focus { outline-color: var(--bad); }

/* ---- The plan carried in from the pricing page ---------------------------
 * "Start with Team" has to still mean Team once the page has changed. It is
 * said here on the way in, and marked on the ladder on the way out.
 */

.plan-picked {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline;
  background: var(--panel); border: 1px solid var(--gold-deep); border-radius: 14px; padding: 16px 18px;
}
.plan-picked-k { grid-column: 1 / -1; color: var(--gold); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.plan-picked-name { font-family: var(--display); font-size: 20px; letter-spacing: -0.02em; }
.plan-picked-price { font-family: var(--display); font-size: 17px; color: var(--text-2); text-align: right; }
.plan-picked-line { grid-column: 1 / -1; color: var(--text-2); font-size: 14px; margin-top: 4px; }
.plan-picked-change { grid-column: 1 / -1; margin-top: 8px; font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; }

.tier.picked { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(226, 169, 59, .25); }
.tier-picked-flag {
  align-self: start; color: #14100A; background: var(--gold); border-radius: 999px;
  padding: 3px 10px; font-size: 12px; font-weight: 600;
}

/* ---- Mobile -------------------------------------------------------------- */

.rail-toggle { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .rail {
    position: sticky; top: 0; height: auto; z-index: 30;
    flex-direction: row; align-items: center; gap: 12px;
    padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--border);
  }
  .rail .brand { flex: 1; min-width: 0; }
  .rail-foot { display: none; }
  nav.areas {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    padding: 8px; gap: 2px; background: var(--ground); border-bottom: 1px solid var(--border);
    box-shadow: 0 24px 48px rgba(0, 0, 0, .38);
  }
  nav.areas.open { display: flex; }
  nav.areas button { min-height: 48px; font-size: 16px; }
  .rail-toggle { display: inline-flex; }
  main.page { padding: 26px 18px 72px; }
  h1 { font-size: 26px; }
  .stat .value { font-size: 28px; }
  dl.facts { grid-template-columns: 1fr; gap: 2px 0; }
  dl.facts dd { margin-bottom: 12px; }
  .device { flex-wrap: wrap; }
  .device .right { margin-left: 52px; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}

/* The Cloud early-access card on Plan & billing and the welcome screen: an
   interest a person can tell us about, never a plan the page can set. */
.tier.early { border-style: dashed; }
.tier.early .price { color: var(--gold); }
.tier .capacities { list-style: none; padding: 0; margin: 4px 0 0; }
.tier .capacities li { padding: 6px 0; border-top: 1px solid var(--border); }
.tier .capacities li.chosen { color: var(--text); font-weight: 600; }
.tier .capacities li.chosen::before { content: '\2713\00a0'; color: var(--gold); }
.tier .foot .plan-picked-change { display: inline-block; margin-top: 10px; }

/* portal integration: inline link buttons inside steps, the check row on the codes screen */
button.link { background: none; border: 0; padding: 0; color: var(--gold); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
button.link:hover { color: var(--gold-hover); }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--gold); }
.tier .price + .field-note { margin-top: -6px; }

/* the agent catalogue on Get started: guidance, not a selector */
.agent-list { display: grid; gap: 8px; margin: 12px 0 0; }
.agent-item { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; display: grid; gap: 6px; }
.agent-item.recommended { border-color: rgba(226, 169, 59, .55); }
.agent-item-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.agent-item-head .quiet { font-size: 12.5px; }
.agent-badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #1A1305; background: var(--gold); }
.agent-more { margin-left: auto; width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 1px solid var(--border); font-weight: 600; }
.agent-more[aria-expanded="true"] { color: #1A1305; background: var(--gold); border-color: var(--gold); }
.agent-more-panel { display: grid; gap: 6px; padding-top: 6px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-2); }
.agent-more-panel[hidden] { display: none; }
.agent-more-panel a { color: var(--gold); }
