/* Vision — Login screen. Built on tokens/*.css (see base.css for canvas). */

.login-page {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  position: relative;
  background: var(--vds-surface-raised);
  border-radius: var(--vds-radius-lg);
  box-shadow: var(--vds-shadow-pop);
  padding: var(--vds-space-48);
  width: 820px;
  max-width: 95vw;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--vds-space-10);
  margin-bottom: var(--vds-space-40);
}

.login-columns {
  display: flex;
  gap: var(--vds-space-48);
}

.login-col {
  flex: 1 1 0;
  min-width: 0;
}

.login-col--verify {
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.login-col--verify.is-active {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 640px) {
  .login-card {
    width: 420px;
  }
  .login-columns {
    flex-direction: column;
    gap: var(--vds-space-24);
  }
}

.login-logo-text {
  
  font-size: 28px;
  font-weight: var(--vds-weight-extrabold);
  color: var(--vds-text-primary);
  letter-spacing: -0.5px;
}

.login-heading {
  font-size: 22px;
  font-weight: var(--vds-weight-bold);
  color: var(--vds-text-primary);
  margin: 0 0 var(--vds-space-6) 0;
}

.login-subtitle {
  font-size: 14px;
  color: var(--vds-text-secondary);
  margin: 0 0 var(--vds-space-24) 0;
}

.login-field-group {
  margin-bottom: var(--vds-space-20);
}

.login-label {
  display: block;
  font-size: 13px;
  font-weight: var(--vds-weight-medium);
  color: var(--vds-text-primary);
  margin-bottom: var(--vds-space-6);
}

.login-input-wrap {
  position: relative;
}

.login-input {
  width: 100%;
  padding: var(--vds-space-10) var(--vds-space-12);
  font-size: 14px;
  font-family: var(--vds-font-sans);
  border: 1.5px solid var(--vds-border);
  border-radius: var(--vds-radius-md);
  outline: none;
  color: var(--vds-text-primary);
  background: var(--vds-bg);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

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

/* 2026-08 visual-consistency unification pass (T3): bump to 16px below
   600px viewport width so iOS Safari doesn't auto-zoom on focus -- matches
   shared-widgets.css's existing @media (max-width: 599.98px) rule for
   .sw-input/.sw-textarea. Font-size only; T1's border/focus treatment is
   explicitly NOT touched here (Login is flagged elsewhere as the app's best
   text-field implementation and stays as-is for that decision). */
@media (max-width: 599.98px) {
  .login-input {
    font-size: 16px;
  }
}

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

.login-input:focus,
.login-input.is-focused {
  border-color: var(--vds-accent);
  box-shadow: 0 0 0 2px var(--vds-accent-soft);
}

.login-input.has-error {
  border-color: var(--vds-danger);
  box-shadow: 0 0 0 2px var(--vds-danger-soft);
}

.login-toggle-password {
  position: absolute;
  right: var(--vds-space-4);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  border-radius: var(--vds-radius-md);
  cursor: pointer;
  color: var(--vds-text-tertiary);
  /* Capped at --vds-space-8, not the fuller ~44px hit-slop this control
     family otherwise gets -- .login-input--password reserves exactly 40px
     of padding-right for this button (see .login-input--password below),
     and .login-input's own height is only ~38-40px, so this is the largest
     hit area that fits without overlapping the typed password or
     overflowing the field's own height. */
  padding: var(--vds-space-8);
  display: flex;
  align-items: center;
  transition: background 120ms ease, color 120ms ease;
}
.login-toggle-password:hover {
  color: var(--vds-text-secondary);
  background: var(--vds-surface);
}

.login-error-text {
  font-size: 12px;
  color: var(--vds-danger);
  margin-top: var(--vds-space-4);
}

.login-button-area {
  margin-top: var(--vds-space-24);
}

.login-signin-btn {
  width: 100%;
  padding: var(--vds-space-12);
  font-size: 15px;
  font-weight: var(--vds-weight-semibold);
  font-family: var(--vds-font-sans);
  background: var(--vds-action);
  color: var(--vds-text-on-dark);
  border: none;
  border-radius: var(--vds-radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--vds-space-8);
  transition: background 150ms ease, transform 80ms ease;
}

.login-signin-btn:hover:not(:disabled) {
  background: var(--vds-action-hover);
}

.login-signin-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.login-signin-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.login-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: var(--vds-radius-full);
  animation: login-spin 0.6s linear infinite;
}

.login-forgot-link {
  display: block;
  width: 100%;
  text-align: center;
  /* margin-top trimmed from --vds-space-16 to --vds-space-4 to offset the
     new padding below -- keeps the text's own vertical position roughly
     where it was, rather than pushing the whole row further down, while
     growing the actual tap height from ~18px (just the text line-box) to
     ~42px (audit-findings.md #293). */
  margin-top: var(--vds-space-4);
  padding: var(--vds-space-12) 0;
  font-size: 13px;
  color: var(--vds-text-secondary);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--vds-font-sans);
  transition: color 120ms ease;
}

.login-forgot-link:hover {
  color: var(--vds-accent);
}

.login-success-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--vds-radius-lg);
  gap: var(--vds-space-12);
  animation: login-fade-in 0.3s ease;
}

/* An author-stylesheet rule beats the UA's default [hidden]{display:none}
   even at equal specificity, so the unconditional `display: flex` above
   would otherwise show this overlay immediately on page load — before any
   sign-in attempt — since it overrides the `hidden` attribute. This rule
   is more specific, so it correctly wins while `hidden` is present. */
.login-success-overlay[hidden] {
  display: none;
}

.login-success-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--vds-radius-full);
  background: var(--vds-success-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--vds-success);
}

.login-success-text {
  font-size: 16px;
  font-weight: var(--vds-weight-semibold);
  color: var(--vds-text-primary);
}

@keyframes login-spin {
  to { transform: rotate(360deg); }
}

@keyframes login-fade-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ---- Verification column: OTP + NFC ------------------------------------ */

.login-otp-group {
  margin-bottom: var(--vds-space-20);
}

.login-otp {
  display: flex;
  gap: var(--vds-space-6);
}

.login-otp-cell {
  width: 36px;
  height: 40px;
  text-align: center;
  font: var(--vds-weight-semibold) 16px/1 var(--vds-font-mono);
  border: 1.5px solid var(--vds-border);
  border-radius: var(--vds-radius-md);
  outline: none;
  color: var(--vds-text-primary);
  background: var(--vds-bg);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.login-otp-cell:focus {
  border-color: var(--vds-accent);
  box-shadow: 0 0 0 2px var(--vds-accent-soft);
}

.login-otp-cell:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.login-or-divider {
  display: flex;
  align-items: center;
  gap: var(--vds-space-12);
  margin: var(--vds-space-20) 0;
}

.login-or-line {
  flex: 1;
  height: 1px;
  background: var(--vds-border);
}

.login-or-text {
  font-size: 12px;
  font-weight: var(--vds-weight-medium);
  color: var(--vds-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-nfc-zone {
  border: 2px dashed var(--vds-border);
  border-radius: var(--vds-radius-default);
  padding: var(--vds-space-24) var(--vds-space-16);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--vds-space-10);
  color: var(--vds-text-tertiary);
  transition: border-color 200ms ease, background 200ms ease;
  user-select: none;
}

.login-nfc-zone[data-state="scanning"] {
  border-color: var(--vds-accent);
  background: var(--vds-accent-soft);
  color: var(--vds-accent);
}

.login-nfc-zone[data-state="scanning"] #nfc-icon {
  animation: login-nfc-pulse 1.2s ease infinite;
}

.login-nfc-zone[data-state="success"] {
  border-style: solid;
  border-color: var(--vds-success);
  background: var(--vds-success-soft);
  color: var(--vds-success);
}

.login-nfc-zone[data-state="error"],
.login-nfc-zone[data-state="mismatch"] {
  border-style: solid;
  border-color: var(--vds-danger);
  background: var(--vds-danger-soft);
  color: var(--vds-danger);
}

.login-nfc-label {
  font-size: 13px;
  font-weight: var(--vds-weight-medium);
  transition: color 200ms ease;
}

.login-nfc-sublabel {
  font-size: 12px;
  color: var(--vds-text-tertiary);
  margin-top: calc(-1 * var(--vds-space-4));
}

@keyframes login-nfc-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
