:root {
  color-scheme: light;
  --page: oklch(0.957 0.011 260);
  --surface: oklch(0.997 0.002 260);
  --surface-soft: oklch(0.978 0.008 260);
  --ink: oklch(0.205 0.032 258);
  --ink-soft: oklch(0.435 0.035 258);
  --ink-inverse: oklch(0.997 0.002 260);
  --line: oklch(0.84 0.02 258);
  --line-strong: oklch(0.7 0.035 258);
  --primary: oklch(0.38 0.145 260);
  --primary-strong: oklch(0.29 0.13 260);
  --success: oklch(0.39 0.095 172);
  --warning: oklch(0.45 0.095 82);
  --danger: oklch(0.42 0.135 24);
  --focus: oklch(0.62 0.12 260);
  --chrome: oklch(0.205 0.032 258);
  --chrome-muted: oklch(0.86 0.025 260);
  --chrome-overlay: oklch(0.205 0.032 258 / 0.68);
  --radius: 6px;
  font-family: "Avenir Next", Avenir, "Segoe UI Variable", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 20;
  transform: translateY(-180%);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  width: min(1220px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 20px 0 28px;
}

.app-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
}

.brand-name {
  margin: 0;
  font-size: 18px;
  font-weight: 760;
  letter-spacing: 0;
}

.brand-tag {
  margin: 1px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.back-link {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 650;
}

.back-link:hover {
  color: var(--primary-strong);
}

.auth-layout {
  min-height: calc(100vh - 122px);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.workspace-context {
  min-height: 600px;
  display: flex;
  align-items: flex-end;
  padding: 40px;
  background-color: var(--chrome-overlay);
  background-image: url("/assets/workbench-review.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-blend-mode: multiply;
  color: var(--ink-inverse);
}

.context-copy {
  max-width: 540px;
  text-shadow: 0 1px 2px var(--chrome);
}

.context-eyebrow,
.eyebrow {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.context-eyebrow {
  color: var(--chrome-muted);
}

.workspace-context h2 {
  max-width: 18ch;
  margin: 0;
  font-size: 36px;
  line-height: 1.08;
  letter-spacing: 0;
}

.workspace-context p:last-child {
  max-width: 52ch;
  margin: 16px 0 0;
  color: var(--chrome-muted);
}

.account-entry {
  display: flex;
  align-items: center;
  padding: 48px;
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.entry-inner {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.eyebrow {
  color: var(--primary);
}

.account-entry h1 {
  margin: 0;
  font-size: 44px;
  line-height: 1.06;
  letter-spacing: 0;
}

.account-entry #primary-copy {
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
}

.action-row {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0 16px;
  font-weight: 720;
  letter-spacing: 0;
  text-decoration: none;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.button.primary {
  border-color: var(--primary-strong);
  background: var(--primary);
  color: var(--surface);
}

.button.secondary {
  background: var(--surface);
  color: var(--ink);
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.button.primary:hover,
.button.primary:focus-visible {
  background: var(--primary-strong);
}

.button.secondary:hover,
.button.secondary:focus-visible {
  border-color: var(--primary);
  background: var(--surface-soft);
  color: var(--primary-strong);
}

.button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.trust-list {
  display: grid;
  gap: 8px;
  margin: 28px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 14px;
  list-style: none;
}

.trust-list li {
  position: relative;
  padding-left: 20px;
}

.trust-list li::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 0.63em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.status-wrap {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 10px 12px;
}

.status {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.status.is-ok {
  color: var(--success);
}

.status.is-warn {
  color: var(--warning);
}

.status.is-error {
  color: var(--danger);
}

.legal-note {
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.workspace-panel {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.workspace-heading h1 {
  margin: 14px 0 0;
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: 0;
  text-wrap: balance;
}

.workspace-heading p {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  text-wrap: pretty;
}

.state-pill,
.storage-label {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: oklch(0.925 0.012 258);
  padding: 2px 9px;
  color: oklch(0.31 0.035 258);
  font-size: 12px;
  font-weight: 700;
}

.state-pill[data-state="ready"] {
  background: oklch(0.955 0.035 172);
  color: var(--success);
}

.state-pill[data-state="error"] {
  background: oklch(0.956 0.04 24);
  color: var(--danger);
}

.provisioning-track {
  display: grid;
  gap: 0;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.provisioning-track li {
  min-height: 64px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  position: relative;
  padding: 0 0 18px;
  color: var(--ink-soft);
}

.provisioning-track li:not(:last-child)::after {
  content: "";
  width: 1px;
  position: absolute;
  top: 24px;
  bottom: 0;
  left: 11px;
  background: var(--line);
}

.step-marker {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
}

.step-marker::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.provisioning-track strong,
.provisioning-track small {
  display: block;
}

.provisioning-track strong {
  color: var(--ink);
  font-size: 14px;
}

.provisioning-track small {
  margin-top: 2px;
  font-size: 12px;
}

.provisioning-track li[data-state="active"] .step-marker {
  border-color: var(--primary);
  background: oklch(0.935 0.038 260);
}

.provisioning-track li[data-state="active"] .step-marker::after {
  background: var(--primary);
}

.provisioning-track li[data-state="done"] .step-marker {
  border-color: var(--success);
  background: var(--success);
}

.provisioning-track li[data-state="done"] .step-marker::after {
  width: 8px;
  height: 4px;
  border: solid var(--surface);
  border-width: 0 0 2px 2px;
  border-radius: 0;
  background: transparent;
  transform: rotate(-45deg) translate(1px, -1px);
}

.workspace-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 4px 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.workspace-facts div {
  min-width: 0;
  padding: 13px 10px 13px 0;
}

.workspace-facts div + div {
  border-left: 1px solid var(--line);
  padding-left: 12px;
}

.workspace-facts dt {
  color: var(--ink-soft);
  font-size: 12px;
}

.workspace-facts dd {
  overflow-wrap: anywhere;
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-transform: capitalize;
}

.upload-form {
  margin-top: 24px;
}

.upload-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.upload-heading h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.upload-heading p {
  max-width: 44ch;
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.storage-label {
  flex: 0 0 auto;
  color: var(--primary-strong);
}

.upload-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
}

.upload-form input[type="file"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 7px;
  color: var(--ink-soft);
  font: inherit;
  font-size: 13px;
}

.upload-form input[type="file"]::file-selector-button {
  min-height: 28px;
  margin-right: 10px;
  border: 0;
  border-radius: 4px;
  background: oklch(0.925 0.012 258);
  padding: 0 10px;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.upload-form input[type="file"]:focus-visible,
.text-button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.upload-form .button {
  width: 100%;
  margin-top: 10px;
}

.workspace-status-wrap {
  margin-top: 18px;
}

.text-button {
  min-height: 36px;
  margin-top: 14px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink-soft);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.text-button:hover {
  color: var(--primary-strong);
}

.no-script {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
}

.no-script h2 {
  margin: 0;
  font-size: 18px;
}

.no-script p {
  margin: 6px 0 0;
  color: var(--ink-soft);
}

@media (max-width: 920px) {
  .auth-layout {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .workspace-context {
    min-height: 300px;
    padding: 28px;
  }

  .account-entry {
    min-height: 520px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 600px) {
  .app-shell {
    width: min(100% - 20px, 1220px);
    padding-top: 10px;
  }

  .app-header {
    min-height: 62px;
  }

  .brand-tag,
  .back-link {
    display: none;
  }

  .workspace-context {
    min-height: 240px;
    padding: 22px;
  }

  .workspace-context h2 {
    font-size: 28px;
  }

  .workspace-context p:last-child {
    display: none;
  }

  .account-entry {
    min-height: 0;
    padding: 34px 22px;
  }

  .account-entry h1 {
    font-size: 36px;
  }

  .workspace-heading h1 {
    font-size: 28px;
  }

  .workspace-facts {
    grid-template-columns: 1fr;
  }

  .workspace-facts div {
    padding: 10px 0;
  }

  .workspace-facts div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-left: 0;
  }

  .upload-heading {
    display: block;
  }

  .storage-label {
    margin-top: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
