/*
  Veyra - the log-in page.
  ==========================================================================

  Self-contained on purpose. It reads the design tokens from veyra-core.css
  and owns everything else, so the page cannot be changed by accident from
  somewhere it does not import: this is the one screen where a broken layout
  means nobody can get in.

  Always dark. The application has a light theme and the marketing site has a
  paper section, but the door into Veyra is the navy one - so nothing here
  waits on a stored theme, and there is no first-paint flash.
*/

/* --------------------------------------------------------------- ground */

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--v-ink-950);
  color: #eaf0fa;
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/*
  One very soft brand glow behind the card. A single radial gradient painted
  into the background - no extra element, nothing animating, nothing to
  repaint on scroll.
*/
.login {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  padding: var(--space-10) var(--space-5);
  background:
    radial-gradient(
      900px 520px at 50% -8%,
      rgba(62, 162, 211, 0.16),
      transparent 68%
    );
}

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

.login :focus-visible {
  outline: 2px solid var(--v-brand-300);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ----------------------------------------------------------------- card */

.login-card {
  width: min(430px, 100%);
  padding: var(--space-10) var(--space-8) var(--space-8);
  background: linear-gradient(180deg, rgba(22, 33, 56, 0.9), rgba(17, 26, 44, 0.9));
  border: 1px solid rgba(148, 175, 214, 0.16);
  border-radius: 14px;
  box-shadow: 0 30px 70px rgba(3, 8, 20, 0.55);
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.login-brand img {
  width: auto;
  height: 34px;
  object-fit: contain;
}

.login-brand span {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.login-eyebrow {
  margin: 0 0 var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--v-brand-300);
}

.login-title {
  margin: 0 0 var(--space-3);
  font-size: clamp(1.75rem, 5vw, 2.15rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.login-title .dot {
  color: var(--v-brand-300);
}

.login-sub {
  margin: 0 0 var(--space-8);
  color: var(--v-ink-300);
  font-size: 0.94rem;
}

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

.login-note,
.login-error {
  margin: 0 0 var(--space-5);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  font-size: 0.88rem;
}

/*
  [hidden] is a user-agent rule, and any author rule setting `display` beats
  it. These two set no display of their own for exactly that reason - but
  say it out loud, because the next person to add `display: flex` here would
  make both messages permanent.
*/
.login-note[hidden],
.login-error[hidden] {
  display: none;
}

.login-note {
  background: rgba(114, 188, 228, 0.1);
  border-color: rgba(114, 188, 228, 0.3);
  color: var(--v-brand-200);
}

.login-error {
  background: rgba(240, 133, 125, 0.12);
  border-color: rgba(240, 133, 125, 0.34);
  color: #ffb9b3;
}

/* --------------------------------------------------------------- fields */

.login-field {
  margin-bottom: var(--space-4);
}

.login-field label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--v-ink-200);
}

.login-field input {
  width: 100%;
  height: 46px;
  padding: 0 var(--space-4);
  background: rgba(10, 16, 32, 0.72);
  border: 1px solid rgba(148, 175, 214, 0.22);
  border-radius: var(--radius-control);
  color: #eaf0fa;
  font-family: inherit;
  font-size: 0.95rem;
  box-sizing: border-box;
  transition:
    border-color var(--duration-fast) var(--ease),
    box-shadow var(--duration-fast) var(--ease);
}

.login-field input::placeholder {
  color: var(--v-ink-500);
}

.login-field input:focus {
  outline: none;
  border-color: var(--v-brand-400);
  box-shadow: 0 0 0 3px rgba(62, 162, 211, 0.18);
}

.login-field input[aria-invalid='true'] {
  border-color: rgba(240, 133, 125, 0.7);
}

/* The password field carries its own control, so the input makes room. */
.login-password {
  position: relative;
}

.login-password input {
  padding-right: 72px;
}

.login-password button {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  height: 34px;
  padding: 0 var(--space-3);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  color: var(--v-ink-300);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    color var(--duration-fast) var(--ease),
    background var(--duration-fast) var(--ease);
}

.login-password button:hover {
  color: #eaf0fa;
  background: rgba(148, 175, 214, 0.1);
}

.login-field-error {
  margin: var(--space-2) 0 0;
  min-height: 1.1em;
  color: #ffb9b3;
  font-size: 0.8rem;
}

/* --------------------------------------------------------------- submit */

.login-submit {
  width: 100%;
  height: 48px;
  margin-top: var(--space-2);
  background: var(--v-brand-300);
  border: none;
  border-radius: var(--radius-control);
  color: var(--v-ink-950);
  font-family: inherit;
  font-size: 0.97rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease),
    opacity var(--duration-fast) var(--ease);
}

.login-submit:hover:not(:disabled) {
  background: var(--v-brand-200);
}

/*
  The disabled state has to stay legible: it is on screen for as long as the
  round trip takes, and a button that fades to near-invisible while it says
  "Logging in..." reads as the page having broken.
*/
.login-submit:disabled {
  opacity: 0.72;
  cursor: progress;
}

.login-switch {
  margin: var(--space-6) 0 0;
  text-align: center;
  color: var(--v-ink-300);
  font-size: 0.88rem;
}

.login-switch a {
  color: var(--v-brand-300);
  font-weight: 500;
}

.login-switch a:hover {
  color: var(--v-brand-200);
  text-decoration: underline;
}

.login-back {
  margin: 0;
  font-size: 0.82rem;
  color: var(--v-ink-400);
}

.login-back a:hover {
  color: var(--v-ink-200);
}

/* ----------------------------------------------------------- responsive */

@media (max-width: 480px) {
  .login {
    padding: var(--space-6) var(--space-4);
    justify-content: flex-start;
  }

  .login-card {
    padding: var(--space-8) var(--space-5) var(--space-6);
    border-radius: 12px;
  }
}

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