/* Copyright (c) 2026 Ulifyi Group. All rights reserved. */
/* Sign-in, sign-up and password reset on auth.uli.fyi: one white design.
   Stands alone (templates/auth/flow.html loads only this file); the account
   pages keep auth.css. Same tokens as the company set-up (pay start.css), so
   the way from "create account" to "your company" looks like one product.

   Layout follows the big account systems: one narrow column, the wordmark on
   top, the question as a large heading, fields that carry their label inside
   (it moves up while typing), one black button, and the way to the other
   page (sign in / create account) as an outlined button at the bottom. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/auth/static/fonts/inter-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #0a0a0a;
  --ink-soft: #3d3f44;
  --muted: #5f6168;
  --faint: #8b8d93;
  --line: #e6e7ea;
  --line-strong: #cdced3;
  --line-hover: #a9aab0;
  --fill: #f5f5f6;
  --fill-hover: #ececee;
  --bad: #b42318;
  --bad-bg: #fef3f2;
  --bad-line: #fdd5d1;
  --good: #067647;
  --ring: rgba(10, 10, 10, 0.08);
  --field: 58px;
  --radius-field: 14px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body {
  min-height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
}
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.icon { width: 18px; height: 18px; flex: none; }
.visually-hidden, .offscreen {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── Frame ─────────────────────────────────────────────────────────────── */

/* One white column. The sign-in has no picture (owner's wish); above the
   sign-up's questions a small picture from the dashboard's own illustrations (Ulifyi Blau: flat rounded shapes in one
   colour family, the Ulifyi arc above, templates/scenes). Kept small, as
   in the dashboard: large they look bad. */
.flow-shell { flex: 1; display: flex; min-height: 100dvh; }
.flow-left { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.step-art { margin: -6px 0 10px; }
.scene { display: block; width: min(260px, 72%); height: auto; margin: 0 auto; overflow: visible; }
.step-art .scene { animation: scene-in 520ms var(--ease) both; }
@keyframes scene-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

.flow-main {
  flex: 1;
  width: min(100% - 40px, 420px);
  margin: 0 auto;
  padding: clamp(24px, 6vh, 64px) 0 40px;
}
.flow-brand { display: inline-flex; margin: 0 0 clamp(22px, 4vh, 36px); color: var(--ink); border-radius: 6px; }
.wordmark-logo { display: block; width: auto; height: 20px; }

.hero { margin: 0 0 28px; }
h1 {
  margin: 0 0 10px;
  font-size: clamp(27px, 5.4vw, 32px);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.028em;
  text-wrap: balance;
}
.lead { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.5; text-wrap: pretty; }
.lead strong { color: var(--ink); font-weight: 600; }
.publisher { color: var(--faint); }

.step { animation: rise 340ms var(--ease) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

form { display: flex; flex-direction: column; gap: 14px; }

/* ── Fields: the label sits inside and moves up ─────────────────────────── */

.field { display: flex; flex-direction: column; gap: 6px; }
.control { position: relative; }
.control input, .control select {
  display: block;
  width: 100%;
  height: var(--field);
  padding: 22px 16px 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-field);
  background: #fff;
  font-size: 16.5px;
  line-height: 1.3;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.control select { appearance: none; padding-right: 40px; cursor: pointer; }
.control.select::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 7px;
  height: 7px;
  border: solid var(--muted);
  border-width: 0 1.6px 1.6px 0;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.control input:hover, .control select:hover { border-color: var(--line-hover); }
.control input:focus, .control select:focus { border-color: var(--ink); box-shadow: 0 0 0 4px var(--ring); }
.control input:-webkit-autofill,
.control input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 100px #fff inset, 0 0 0 0 transparent;
  caret-color: var(--ink);
}

.control > label {
  position: absolute;
  left: 17px;
  top: 50%;
  max-width: calc(100% - 34px);
  overflow: hidden;
  color: var(--faint);
  font-size: 16.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
  transform: translateY(-50%);
  transform-origin: left top;
  pointer-events: none;
  transition: top 160ms var(--ease), transform 160ms var(--ease), font-size 160ms var(--ease), color 160ms ease;
}
.control input:focus + label,
.control input:not(:placeholder-shown) + label,
.control input:-webkit-autofill + label,
.control.fixed > label {
  top: 9px;
  transform: none;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}
.control input:focus + label { color: var(--ink); }

/* "@" in front of the username, always visible. */
.control.prefixed input { padding-left: 34px; }
.control.prefixed > label { left: 17px; }
.control .prefix {
  position: absolute;
  left: 17px;
  bottom: 9px;
  color: var(--faint);
  font-size: 16.5px;
  line-height: 1.3;
  pointer-events: none;
}

.control .code-field { font-size: 19px; letter-spacing: 0.32em; font-variant-numeric: tabular-nums; }

.field.invalid .control input, .field.invalid .control select { border-color: var(--bad); }
.field.invalid .control input:focus { box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.1); }
.field.invalid .control > label { color: var(--bad); }

#password, #new-password, #confirm-password { padding-right: 52px; }
.reveal {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  transform: translateY(-50%);
  cursor: pointer;
}
.reveal:hover { color: var(--ink); background: var(--fill); }
.reveal-show { display: flex; }
.reveal .reveal-hide, .reveal[aria-pressed="true"] .reveal-show { display: none; }
.reveal[aria-pressed="true"] .reveal-hide { display: flex; }

.error { margin: 2px 0 0; color: var(--bad); font-size: 13.5px; font-weight: 500; animation: shake 260ms ease-in-out; }
.error:empty { display: none; }
@keyframes shake {
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.hint { margin: 2px 2px 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.hint.ok { color: var(--good); }

/* Birthday: three boxes in a row. */
.birthday-row { display: grid; grid-template-columns: 1fr 1.6fr 1.2fr; gap: 10px; }
.field.invalid .birthday-row .control input, .field.invalid .birthday-row .control select { border-color: var(--bad); }

/* ── Buttons and links ─────────────────────────────────────────────────── */

.btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, transform 120ms var(--ease), opacity 140ms ease;
}
.btn:active { transform: scale(0.985); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #26272b; }
.btn.ghost { border-color: var(--line-strong); background: #fff; color: var(--ink); }
.btn.ghost:hover { border-color: var(--line-hover); background: var(--fill); }
.btn .icon { width: 17px; height: 17px; }
.btn.primary .arrow { transition: transform 160ms var(--ease); }
.btn.primary:hover .arrow { transform: translateX(2px); }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn.loading .btn-label, .btn.loading .icon { opacity: 0; }
.btn.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
.btn.loading { cursor: progress; }
@keyframes spin { to { transform: rotate(360deg); } }

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 550;
  text-decoration: underline;
  text-decoration-color: var(--line-hover);
  text-underline-offset: 3px;
  cursor: pointer;
}
.link:hover { text-decoration-color: var(--ink); }
.link.small { color: var(--muted); font-size: 14px; font-weight: 500; }
.link.small:hover { color: var(--ink); }
.link:disabled { opacity: 0.6; cursor: default; text-decoration: none; }
.center { text-align: center; }
.forgot { margin: 6px 0 0; text-align: center; }
.forgot-row { margin: 4px 2px 0; text-align: right; }

.btn:focus-visible, .link:focus-visible, .reveal:focus-visible, .flow-brand:focus-visible,
.nav-back:focus-visible, .identity-pill:focus-visible, .chip:focus-visible, .choice:has(input:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.divider { display: flex; align-items: center; gap: 14px; margin: 18px 0; color: var(--faint); font-size: 13.5px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* The way to the other page, at the bottom of the column. */
.switch-page { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.switch-page p { margin: 0 0 12px; color: var(--muted); font-size: 14.5px; text-align: center; }

/* ── Notices ───────────────────────────────────────────────────────────── */

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 1px solid var(--bad-line);
  border-radius: 12px;
  background: var(--bad-bg);
  color: var(--bad);
  font-size: 14px;
  line-height: 1.45;
  animation: rise 240ms var(--ease) both;
}
.notice .icon { margin-top: 1px; }
.notice.soft { border-color: var(--line); background: var(--fill); color: var(--ink-soft); }

.dev-code { margin: 0; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); font-size: 13.5px; }
.dev-code strong { color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: 0.12em; }

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

.identity { margin: -4px 0 4px; }
.identity-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  font-size: 14.5px;
  font-weight: 550;
  cursor: pointer;
}
.identity-pill:hover { border-color: var(--line-hover); background: var(--fill); }
.identity-initial {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  text-transform: uppercase;
}
.identity-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity-pill .icon { width: 16px; height: 16px; color: var(--muted); }

.remember, .consent {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.5;
  cursor: pointer;
  user-select: none;
}
.remember { align-items: center; }
.remember input, .consent input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.box {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 1px;
  border: 1.5px solid var(--line-hover);
  border-radius: 6px;
  color: transparent;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.remember .box { margin-top: 0; }
.box .icon { width: 14px; height: 14px; stroke-width: 2.4; }
.remember input:checked + .box, .consent input:checked + .box { border-color: var(--ink); background: var(--ink); color: #fff; }
.remember input:focus-visible + .box, .consent input:focus-visible + .box { outline: 2px solid var(--ink); outline-offset: 2px; }
.field.invalid .consent .box { border-color: var(--bad); }

/* "Continue as …" */
.account {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.avatar { width: 48px; height: 48px; flex: none; border-radius: 50%; object-fit: cover; background: var(--fill); }
.account-text { display: flex; flex-direction: column; min-width: 0; }
.account-name { overflow: hidden; font-size: 16px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.account-sub { overflow: hidden; color: var(--muted); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
#session-step .btn + .btn { margin-top: 10px; }

/* Second factor, passkey offer, restore, sent mail, done. */
.offer-mark { width: 64px; height: 64px; margin: 0 0 24px; }
.offer-mark .mini { display: block; width: 64px; height: 64px; }
.offer h1 + .lead { margin-bottom: 26px; }
.offer-actions { display: flex; flex-direction: column; gap: 10px; }
.offer-note { margin: 16px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.code-form .btn.ghost { margin-top: 0; }
.code-back { margin: 6px auto 0; }


/* ── Sign-up ───────────────────────────────────────────────────────────── */

.register-progress { height: 3px; margin: 0 0 28px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.register-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--ink); transition: width 360ms var(--ease); }
.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: -6px 0 14px -8px;
  padding: 6px 10px 6px 6px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
}
.nav-back:hover { background: var(--fill); color: var(--ink); }
.nav-back .icon { width: 16px; height: 16px; }

.register-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 4px; }

.google-g { width: 20px; height: 20px; flex: none; }
/* "Mit Google fortfahren" comes first, above the address: the quickest way
   in for most people; Google's own mark on a white pill. */
.register-google { margin: 4px 0 0; }
.google-button { gap: 12px; color: var(--ink); }
.google-button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.identity-google {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.identity-google img { border-radius: 50%; background: var(--fill); object-fit: cover; }
.identity-google > span { display: flex; flex-direction: column; min-width: 0; color: var(--muted); font-size: 13.5px; }
.identity-google strong { color: var(--ink); font-size: 15px; }

.suggestions { margin: -2px 0 2px; }
.suggestions .label { display: block; margin: 0 0 8px; color: var(--muted); font-size: 13.5px; font-weight: 550; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }

.summary { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; }
.summary-initial {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 19px;
  font-weight: 650;
}
.summary-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.summary-text strong { color: var(--ink); font-size: 16px; }
.field .consent + .error + .consent { margin-top: 10px; }
.app-privacy { margin: 0; font-size: 14px; }

/* What the account is for (asked at the end when nothing told us). */
.choices { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; }
.choice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #fff;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.choice:hover { border-color: var(--line-hover); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.choice-mark { display: block; width: 52px; height: 52px; flex: none; }
.choice-mark .mini { display: block; width: 52px; height: 52px; }
.choice-text { display: grid; gap: 2px; min-width: 0; }
.choice-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
.choice-hint { color: var(--muted); font-size: 14px; line-height: 1.45; }
.tag { padding: 2px 8px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 550; }
.purpose-reason { margin: 4px 2px 0; color: var(--muted); font-size: 13.5px; }

/* ── Footer ────────────────────────────────────────────────────────────── */

.footer { padding: 20px 24px 28px; color: var(--faint); font-size: 12.5px; text-align: center; }
.footer p { margin: 0; }
.footer p + p { margin-top: 4px; }
.footer a { color: var(--faint); text-underline-offset: 3px; }
.footer a:hover { color: var(--ink); }
.env strong { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Password strength (sign-up) ───────────────────────────────────────── */

.strength { display: flex; align-items: center; gap: 10px; margin: 4px 2px 0; }
.strength-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; flex: 1; }
.strength-bars i { height: 4px; border-radius: 2px; background: var(--line); transition: background-color 200ms ease; }
.strength[data-level="1"] i:nth-child(-n+1),
.strength[data-level="2"] i:nth-child(-n+2),
.strength[data-level="3"] i:nth-child(-n+3),
.strength[data-level="4"] i { background: var(--ink); }
.strength[data-level="1"] i:nth-child(-n+1) { background: var(--bad); }
.strength-label { min-width: 64px; color: var(--muted); font-size: 13px; font-weight: 550; text-align: right; }

/* A work account on the personal sign-in: the way to the Business door. */
.work-door { flex-direction: column; align-items: stretch; gap: 12px; }
.work-door .btn { height: 44px; font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
}
