/*
  Veyra - authentication pages (sign up / log in).

  Sits between the marketing site and the app: it uses the app's navy ground
  and the homepage's typography, so signing in feels like walking through a
  door rather than landing on a different product.
*/

:root {
  /* Aliases onto veyra-core.css. See app.css for why these names remain. */
  --auth-bg: var(--bg);
  --auth-surface: var(--surface);
  --auth-raise: var(--surface-raised);
  --auth-line: var(--border);
  --auth-line-strong: var(--border-strong);
  --auth-text: var(--text);
  --auth-muted: var(--text-secondary);
  --auth-cyan: var(--accent);
  --auth-out: var(--danger);
  --auth-low: var(--warning);
  --auth-ok: var(--success);

  --auth-display: var(--font-sans);
  --auth-mono: var(--font-mono);
}



body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--auth-bg);
  color: var(--auth-text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

:focus-visible {
  outline: 2px solid var(--auth-cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ------------------------------------------------------------------ bar */

.auth-bar {
  padding: 26px 0;
}

.auth-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.auth-brand img {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-control);
  object-fit: cover;
}

.auth-brand span {
  font-family: var(--auth-display);
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.04em;
}

/* ---------------------------------------------------------------- frame */

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 0 72px;
}

.auth-card {
  width: min(452px, calc(100% - 40px));
}

.auth-eyebrow {
  margin: 0 0 18px;
  font-family: var(--auth-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--auth-cyan);
}

.auth-title {
  margin: 0 0 12px;
  font-family: var(--auth-display);
  font-size: clamp(2rem, 5vw, 2.7rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.auth-title .stop {
  color: var(--auth-cyan);
}

.auth-sub {
  margin: 0 0 34px;
  color: var(--auth-muted);
  font-size: 0.98rem;
}

/* ---------------------------------------------------------------- steps */

/* Three-step marker: create account, sign in, dashboard. Tells a new
   visitor the account form is not the last thing standing between them
   and the product. */
.auth-steps {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 30px;
  padding: 0;
  list-style: none;
  font-family: var(--auth-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* An author `display` rule beats the UA stylesheet's [hidden] rule, so the
   attribute has to be honoured explicitly or the marker shows on a plain
   login visit - claiming an account was just created when none was. */
.auth-steps[hidden] {
  display: none;
}

.auth-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-steps li::after {
  content: "";
  width: 14px;
  height: 1px;
  background: var(--auth-line-strong);
}

.auth-steps li:last-child::after {
  display: none;
}

.auth-steps .is-current {
  color: var(--auth-cyan);
}

.auth-steps .is-done {
  color: var(--auth-ok);
}

/* ---------------------------------------------------------------- form */

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

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-family: var(--auth-mono);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--auth-muted);
}

.field input {
  width: 100%;
  min-height: 50px;
  padding: 10px 15px;
  border: 1px solid var(--auth-line-strong);
  border-radius: var(--radius-control);
  background: var(--auth-bg);
  color: var(--auth-text);
  font: inherit;
  font-size: 0.98rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder {
  color: var(--text-tertiary);
}

.field input:focus {
  outline: none;
  border-color: var(--auth-cyan);
  box-shadow: 0 0 0 3px var(--accent-quiet);
}

.field input[aria-invalid="true"] {
  border-color: var(--auth-out);
}

.field input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px var(--danger-quiet);
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

/* Per-field message. Kept out of the flow when empty so the form does not
   jump as messages appear and clear. */
.field-error {
  min-height: 0;
  font-size: 0.8rem;
  color: var(--auth-out);
}

.field-error:empty {
  display: none;
}

/* --------------------------------------------------------- form notices */

.auth-alert {
  margin: 0;
  padding: 13px 15px;
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  font-size: 0.88rem;
}

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

.auth-alert-error {
  border-color: var(--danger);
  background: var(--danger-quiet);
  color: var(--auth-out);
}

.auth-alert-ok {
  border-color: var(--success);
  background: var(--success-quiet);
  color: var(--auth-ok);
}

.auth-alert-note {
  border-color: var(--auth-line-strong);
  background: var(--surface-raised);
  color: var(--auth-muted);
}

/* -------------------------------------------------------------- buttons */

.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  margin-top: 4px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--auth-cyan);
  color: var(--accent-contrast);
  font: inherit;
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.auth-submit:hover:not(:disabled) {
  background: var(--accent-hover);
}

.auth-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-switch {
  margin: 26px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--auth-line);
  color: var(--auth-muted);
  font-size: 0.9rem;
}

.auth-switch a {
  color: var(--auth-cyan);
  font-weight: 500;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------- footer */

.auth-foot {
  padding: 0 0 30px;
  color: var(--text-tertiary);
  font-size: 0.78rem;
}

.auth-foot a {
  color: var(--text-tertiary);
}

.auth-foot a:hover {
  color: var(--auth-cyan);
}

/* Honest banner while the local development provider is in use. */
.auth-dev-note {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px dashed var(--auth-line-strong);
  border-radius: var(--radius-control);
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-tertiary);
}

.auth-dev-note strong {
  color: var(--auth-low);
  font-weight: 600;
}

@media (max-width: 620px) {
  .auth-shell {
    width: calc(100% - 32px);
  }

  .auth-main {
    align-items: flex-start;
    padding-top: 8px;
  }

  .auth-steps {
    gap: 7px;
    font-size: 0.58rem;
  }

  .auth-steps li {
    gap: 7px;
  }
}

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