/*
 * Auth entry consumes the canonical Vertical Flows presentation tokens.
 * Every --vf-* declaration here must stay textually identical to the
 * definition in app/vee/vee-theme.css; the presentation-layer validator
 * fails on drift. No raw colour, duration, or easing below this block.
 */
:root {
  color-scheme: light dark;
  --vf-ink: light-dark(#0e1116, #eceef1);
  --vf-carbon: light-dark(#2a2e37, #c6cbd3);
  --vf-slate: light-dark(#5b6068, #9aa1ab);
  --vf-paper: light-dark(#ffffff, #1b1f26);
  --vf-gallery: light-dark(#f7f7f2, #15181d);
  --vf-hairline: light-dark(rgba(14, 17, 22, 0.08), rgba(255, 255, 255, 0.1));
  --vf-go: light-dark(#0f8f72, #2fae8c);
  --vf-go-deep: light-dark(#0a6b55, #4cc9a4);
  --vf-go-wash: light-dark(#e7f6f1, #14302a);
  --vf-stop: light-dark(#c8394a, #f97583);
  --vf-on-signal: light-dark(#ffffff, #15181d);
  --vf-text-label: 12px;
  --vf-text-small: 13px;
  --vf-text-reading: 16px;
  --vf-text-display: clamp(30px, 4vw, 42px);
  --vf-radius-card: 8px;
  --vf-control-weight: 450;
  --vf-weight-heading: 600;
  --vf-duration-fast: 120ms;
  --vf-duration-moderate: 180ms;
  --vf-ease: cubic-bezier(0.2, 0, 0, 1);
  --vf-ease-enter: cubic-bezier(0, 0, 0.2, 1);
  color: var(--vf-ink);
  background: var(--vf-gallery);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--vf-gallery);
  color: var(--vf-ink);
}

.vf-auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.vf-auth-panel {
  display: grid;
  align-content: center;
  gap: 24px;
  width: min(100%, 620px);
  min-height: 100vh;
  min-height: 100dvh;
  padding: 28px 20px;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--vf-paper), var(--vf-gallery) 140%);
}

.vf-auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--vf-carbon);
  font-weight: var(--vf-weight-heading);
}

.vf-auth-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--vf-paper);
  background: var(--vf-ink);
}

/* One card stays in place; only the stage's inner content fades/slides
   between states. Motion is tokenised and disabled under reduced motion. */
.vf-auth-stage {
  display: grid;
  gap: 24px;
}

.vf-auth-stage.is-entering {
  animation: vfAuthEnter var(--vf-duration-moderate) var(--vf-ease-enter);
}

@keyframes vfAuthEnter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.vf-auth-copy {
  display: grid;
  gap: 10px;
}

.vf-auth-kicker {
  margin: 0;
  color: var(--vf-go-deep);
  font-size: var(--vf-text-label);
  font-weight: var(--vf-control-weight);
  text-transform: none;
  letter-spacing: 0;
}

.vf-auth-copy h1 {
  max-width: 16ch;
  margin: 0;
  color: var(--vf-ink);
  font-size: var(--vf-text-display);
  line-height: 1.1;
  letter-spacing: 0;
  font-weight: var(--vf-weight-heading);
}

.vf-auth-copy p {
  max-width: 56ch;
  margin: 0;
  color: var(--vf-slate);
  font-size: var(--vf-text-reading);
}

.vf-auth-form {
  display: grid;
  gap: 14px;
}

.vf-auth-fields {
  display: grid;
  gap: 14px;
}

.vf-auth-fields[hidden] {
  display: none;
}

.vf-auth-note {
  margin: 0;
  color: var(--vf-slate);
  font-size: var(--vf-text-small);
}

.vf-auth-note[hidden] {
  display: none;
}

.vf-auth-error {
  margin: 0;
  color: var(--vf-stop);
  font-size: var(--vf-text-small);
}

.vf-auth-error[hidden] {
  display: none;
}

.vf-auth-label {
  display: grid;
  gap: 7px;
  color: var(--vf-carbon);
  font-weight: var(--vf-control-weight);
}

.vf-auth-input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--vf-hairline);
  border-radius: var(--vf-radius-card);
  padding: 12px 13px;
  background: var(--vf-gallery);
  color: var(--vf-ink);
  font: inherit;
  transition:
    border-color var(--vf-duration-fast) var(--vf-ease),
    background-color var(--vf-duration-fast) var(--vf-ease);
}

.vf-auth-input:focus {
  outline: 2px solid color-mix(in srgb, var(--vf-go) 24%, transparent);
  outline-offset: 1px;
  border-color: var(--vf-go);
  background: var(--vf-paper);
}

.vf-auth-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.vf-auth-button {
  min-height: 46px;
  border: 1px solid var(--vf-hairline);
  border-radius: var(--vf-radius-card);
  padding: 11px 14px;
  background: var(--vf-paper);
  color: var(--vf-ink);
  font: inherit;
  font-weight: var(--vf-control-weight);
  cursor: pointer;
  transition:
    color var(--vf-duration-fast) var(--vf-ease),
    background-color var(--vf-duration-fast) var(--vf-ease),
    border-color var(--vf-duration-fast) var(--vf-ease);
}

.vf-auth-button:hover {
  border-color: color-mix(in srgb, var(--vf-ink) 22%, var(--vf-hairline));
}

/* The CTA is precise and refined rather than a heavy green slab: a calm,
   deep signal fill with a single restrained hairline. */
.vf-auth-button[data-primary="true"] {
  background: var(--vf-go-deep);
  border-color: var(--vf-go-deep);
  color: var(--vf-on-signal);
}

.vf-auth-button[data-primary="true"]:hover {
  background: var(--vf-go);
  border-color: var(--vf-go);
}

.vf-auth-alt {
  margin: 0;
  text-align: center;
}

.vf-auth-alt[hidden] {
  display: none;
}

.vf-auth-link {
  border: 0;
  background: transparent;
  padding: 4px 2px;
  color: var(--vf-go-deep);
  font: inherit;
  font-weight: var(--vf-control-weight);
  cursor: pointer;
  text-underline-offset: 3px;
}

.vf-auth-link:hover,
.vf-auth-link:focus-visible {
  color: var(--vf-ink);
  text-decoration: underline;
}

.vf-auth-trust {
  min-height: 20px;
  margin: 0;
  color: var(--vf-slate);
  font-size: var(--vf-text-small);
}

/* Softer split: the proof rail reads as a calm deep-ink panel with a hint of
   the brand signal, not a hard black slab against the light sign-in panel. */
.vf-auth-rail {
  display: none;
  padding: 28px;
  border-left: 1px solid var(--vf-hairline);
  background: linear-gradient(
    165deg,
    color-mix(in srgb, var(--vf-ink) 88%, var(--vf-go-deep) 12%),
    color-mix(in srgb, var(--vf-ink) 72%, var(--vf-go-deep) 28%)
  );
  color: var(--vf-paper);
}

.vf-auth-rail dl {
  display: grid;
  align-content: center;
  gap: 22px;
  min-height: 100%;
  max-width: 30ch;
  margin: 0;
}

.vf-auth-rail dt {
  color: var(--vf-go-wash);
  font-weight: var(--vf-weight-heading);
}

.vf-auth-rail dd {
  margin: 4px 0 0;
  color: color-mix(in srgb, var(--vf-paper) 74%, transparent);
}

@media (min-width: 860px) {
  .vf-auth-shell {
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.45fr);
  }

  .vf-auth-panel {
    padding: 52px;
  }

  .vf-auth-rail {
    display: block;
  }
}

/* Motion is optional; the page stays fully usable without it. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
