/* Sign-in pages that stay server-rendered (login, second factor, invitation, reset, forgotten
   password, OAuth consent). Same look as the React app (frontend/src/styles/tokens.css,
   "Satzspiegel"): paper and ink, Archivo with its condensed cut for headlines, orange for the
   one action, indigo only for AI, hairlines, small radii, visible focus. No framework, no
   external requests; the font is served by Wirevo itself. */

@font-face { font-family: "Archivo Variable"; src: url("fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Archivo Variable"; src: url("fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2-variations"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Wirevo Amp"; src: local("Arial"), local("Helvetica Neue"), local("Helvetica"), local("Liberation Sans"); unicode-range: U+0026; }

.auth {
  --chrome: #1b1b18;
  --chrome-2: #2c2b27;
  --on-chrome-2: #5f5d56;
  --action: #fe9900;
  --action-hover: #f08c00;
  --action-ink: #2b1400;
  --action-soft: #fff1dc;
  --ai: #5048d8;
  --ai-soft: #efeefd;
  --ink: #1b1b18;
  --ink-2: #45443e;
  --ink-3: #5f5d56;
  --line: #dddad2;
  --line-2: #e9e7e1;
  --bg: #f2f1ed;
  --surface: #ffffff;
  --hover: #efede8;
  --ok: #1f7a3a;
  --ok-soft: #e3f2e6;
  --block: #c4271c;
  --block-soft: #fdeae7;
  --info: #0060c0;
  --info-soft: #e7eff9;
  --focus: #1b1b18;
  --sans: "Wirevo Amp", "Archivo Variable", "Segoe UI", system-ui, sans-serif;
  --display: "Wirevo Amp", "Archivo Variable", "Arial Narrow", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --r: 4px;
}
.auth *,
.auth *::before,
.auth *::after {
  box-sizing: border-box;
}
html:has(body.auth) {
  overflow-x: clip;
}
body.auth {
  margin: 0;
  min-height: 100dvh;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
.auth h1,
.auth h2,
.auth p {
  margin: 0;
}
.auth a.auth-brand {
  color: var(--ink);
  text-decoration: none;
}
.auth a {
  color: var(--info);
}
.auth :focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* --- Brand ---------------------------------------------------------------------------- */
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  line-height: 1.1;
}
.auth-brand svg {
  width: 36px;
  height: 36px;
  flex: none;
}
.auth-brand b {
  display: block;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.auth-brand small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* --- Split layout of the login: the promise left, the form right ----------------------- */
.auth-split {
  display: grid;
  grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
  min-height: 100dvh;
}
.auth-side {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 28px;
  padding: 40px 56px 32px;
  background: var(--chrome);
  color: #fff;
}
.auth-side::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(55% 45% at 85% 18%, rgba(254, 153, 0, 0.1), transparent 70%);
}
.auth-side .auth-brand small {
  color: var(--on-chrome-2);
}
.auth-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px;
  align-items: center;
  align-self: center;
}
.auth-side h1 {
  margin-bottom: 14px;
  font-size: clamp(26px, 2.6vw, 34px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.4px;
}
.auth-side h1 em {
  font-style: normal;
  color: var(--action);
}
.auth-side p {
  max-width: 42ch;
  color: #dbe4ec;
}
.auth-side ul {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  color: #dbe4ec;
  font-size: 14px;
}
.auth-side li {
  position: relative;
  padding-left: 22px;
}
.auth-side li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 12px;
  height: 2px;
  border-radius: 1px;
  background: var(--action);
}
.auth-side footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  color: var(--on-chrome-2);
}

/* The miniature page: the product in one glance (headline, columns, a chart, an AI proposal). */
.auth-page {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 10px;
  width: 232px;
  aspect-ratio: 210 / 297;
  margin-right: 28px;
  padding: 18px 16px;
  background: #fff;
  color: var(--ink);
  border-radius: 2px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.55);
  transform: rotate(-2deg);
}
.auth-page .kicker {
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #8a4b00;
}
.auth-page .head {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
}
.auth-page .cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-content: start;
}
.auth-page .col {
  display: grid;
  gap: 4px;
  align-content: start;
}
.auth-page .l {
  height: 3px;
  border-radius: 2px;
  background: #cfd5dc;
}
.auth-page .l.s {
  width: 62%;
}
.auth-page .l.gap {
  margin-top: 3px;
}
.auth-page .l.ins {
  background: #d8cdfb;
}
.auth-page .chart {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  margin-top: 4px;
  padding: 6px;
  border: 1px solid var(--line);
}
.auth-page .bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 34px;
}
.auth-page .bars i {
  flex: 1;
  border-radius: 1px 1px 0 0;
  background: var(--chrome);
  opacity: 0.85;
}
.auth-page .bars i:nth-child(4) {
  background: var(--action);
  opacity: 1;
}
.auth-page .cap,
.auth-page .folio {
  font-size: 6px;
  color: var(--ink-3);
}
.auth-page .folio {
  display: flex;
  justify-content: space-between;
  padding-top: 5px;
  border-top: 1px solid var(--line);
}
.auth-chip {
  position: absolute;
  right: -26px;
  top: 47%;
  display: grid;
  gap: 1px;
  padding: 7px 10px;
  border-radius: 6px;
  border-left: 3px solid var(--ai);
  background: #fff;
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}
.auth-chip b {
  color: var(--ai);
}
.auth-chip small {
  font-size: 9px;
  font-weight: 400;
  color: var(--ink-3);
}

/* --- Form column / single card pages ------------------------------------------------- */
.auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 32px 24px;
  min-width: 0;
}
.auth-solo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  min-height: 100dvh;
  padding: 32px 16px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.auth-card.wide {
  max-width: 560px;
}
.auth-card h1,
.auth-card h2 {
  margin-bottom: 6px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.2px;
  overflow-wrap: anywhere;
}
.auth-lead {
  margin-bottom: 20px !important;
  color: var(--ink-2);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.auth-card p {
  color: var(--ink-2);
  font-size: 14px;
}
.auth-card p + p {
  margin-top: 12px;
}
.auth-mobile-brand {
  display: none;
  margin-bottom: 22px;
}

.auth label,
.auth .auth-label {
  display: block;
  margin: 14px 0 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}
.auth input[type="email"],
.auth input[type="password"],
.auth input[type="text"],
.auth input:not([type]),
.auth select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #cfd5dc;
  border-radius: var(--r);
  background: #fff;
  color: inherit;
  font: inherit;
  transition: border-color 140ms;
}
.auth input:hover,
.auth select:hover {
  border-color: #aab3be;
}
.auth input:focus-visible,
.auth select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--focus);
}
.auth input.code {
  height: 52px;
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: 0.4em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.auth-pw {
  position: relative;
}
.auth-pw input {
  padding-right: 96px;
}
.auth-pw button {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font: 500 13px var(--sans);
  cursor: pointer;
}
.auth-pw button:hover {
  background: var(--hover);
  border-color: var(--line);
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  margin-top: 22px;
  padding: 0 16px;
  border: 1px solid var(--action);
  border-radius: var(--r);
  background: var(--action);
  color: var(--action-ink);
  font: 600 15px var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background 140ms;
}
.auth-btn:hover {
  background: var(--action-hover);
  border-color: var(--action-hover);
}
.auth-btn.secondary {
  margin-top: 12px;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}
.auth-btn.secondary:hover {
  background: var(--hover);
}
.auth-btn.inline {
  width: auto;
}
.auth-btn svg {
  flex: none;
}
.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 0;
  color: var(--ink-3);
  font-size: 12px;
}
.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.auth-or + .auth-btn {
  margin-top: 12px;
}

.auth-error,
.auth-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--r);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.auth-error {
  border: 1px solid #efc6c2;
  background: var(--block-soft);
  color: var(--block);
}
.auth-note {
  border: 1px solid #c9dcf2;
  background: var(--info-soft);
  color: var(--info);
}
.auth-note.ok {
  border-color: #bfe6cf;
  background: var(--ok-soft);
  color: var(--ok);
}
.auth-error svg,
.auth-note svg {
  flex: none;
  margin-top: 2px;
}
.auth-meta {
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
  text-align: center;
}
.auth-card .auth-meta {
  margin-top: 18px;
  text-align: left;
}

/* --- OAuth consent ------------------------------------------------------------------- */
.auth-top {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 16px;
  background: var(--chrome);
  color: #fff;
}
.auth-top .auth-brand b {
  font-size: 17px;
}
.auth-top .auth-brand svg {
  width: 28px;
  height: 28px;
}
.auth-top span {
  color: var(--on-chrome-2);
  font-size: 14px;
}
.auth-consent {
  display: grid;
  gap: 16px;
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 16px;
}
.auth-scope {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.auth-scope li,
.auth-scope label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
}
.auth-scope .ai {
  border-color: #d8cdfb;
  background: var(--ai-soft);
}
.auth-scope .ai b {
  color: var(--ai);
}
.auth-scope input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--ai);
}
.auth-scope svg {
  margin-top: 2px;
  color: var(--ok);
}
.auth-small {
  font-size: 12px !important;
  color: var(--ink-3) !important;
  overflow-wrap: anywhere;
}
.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.auth-actions .auth-btn {
  width: auto;
  margin: 0;
}

/* Agent access list (inside the shared app header) */
.auth-grants {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  font-family: var(--sans);
}
.auth-grants .auth-card {
  max-width: none;
  padding: 20px;
}
.auth-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.auth-table th {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.auth-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-2);
  overflow-wrap: anywhere;
}
.auth-link-danger {
  padding: 4px 8px;
  border: 1px solid #efc6c2;
  border-radius: 6px;
  background: #fff;
  color: var(--block);
  font: 500 13px var(--sans);
  cursor: pointer;
}
.auth-link-danger:hover {
  background: var(--block-soft);
}

/* --- Narrow windows ------------------------------------------------------------------ */
@media (max-width: 1100px) {
  .auth-hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .auth-page {
    display: none;
  }
}
@media (max-width: 820px) {
  .auth-split {
    grid-template-columns: minmax(0, 1fr);
  }
  .auth-side {
    display: none;
  }
  .auth-mobile-brand {
    display: inline-flex;
  }
  .auth-card {
    padding: 26px 20px;
  }
}
@media (max-width: 760px) {
  .auth-table thead {
    display: none;
  }
  .auth-table,
  .auth-table tbody,
  .auth-table tr,
  .auth-table td {
    display: block;
    width: 100%;
  }
  .auth-table tr {
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
  }
  .auth-table td {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 8px;
    padding: 4px 0;
    border: 0;
  }
  .auth-table td::before {
    content: attr(data-label);
    color: var(--ink-3);
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .auth * {
    transition: none !important;
  }
}

/* --- "Satzspiegel": the front page on paper, the form on a white sheet ------------------ */
.auth-side {
  background: var(--bg);
  color: var(--ink);
  border-top: 4px solid var(--action);
  border-right: 1px solid #cbc7bc;
}
.auth-side::before {
  display: none;
}
.auth-side .auth-brand small {
  color: var(--ink-3);
}
.auth-brand b {
  font-family: var(--display);
  font-stretch: 78%;
  font-size: 22px;
  font-weight: 800;
}
.auth-side h1 {
  font-family: var(--display);
  font-stretch: 78%;
  font-size: clamp(40px, 4.4vw, 64px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}
.auth-side h1 em {
  font-style: normal;
  color: #b35300;
}
.auth-side p,
.auth-side ul {
  color: var(--ink-2);
}
.auth-side footer {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
}
.auth-page {
  box-shadow: 0 0 0 1px #cbc7bc, 8px 8px 0 rgba(27, 27, 24, 0.07);
}
.auth-page .l {
  background: #dcd9d0;
}
.auth-chip {
  border-radius: 3px;
  box-shadow: 0 0 0 1px #cbc7bc, 4px 4px 0 rgba(27, 27, 24, 0.07);
}
.auth-main {
  background: var(--surface);
}
.auth-card {
  border: 0;
  border-top: 3px solid var(--ink);
  border-radius: 0;
  padding: 26px 0 0;
  background: transparent;
}
.auth-card h1,
.auth-card h2 {
  font-family: var(--display);
  font-stretch: 78%;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.05;
}
.auth input[type="email"],
.auth input[type="password"],
.auth input[type="text"],
.auth input:not([type]),
.auth select {
  border-color: #8a877d;
}
.auth input:hover,
.auth select:hover {
  border-color: #5f5d56;
}
.auth-pw button {
  border-radius: 3px;
}
.auth-btn {
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.14);
  font-weight: 700;
}
.auth-solo {
  border-top: 4px solid var(--action);
}
