/* ========================================================================
   Auth pages — Sign In, Sign Up, Forgot Password
   Enterprise security aesthetic: precise, confident, trustworthy
   ======================================================================== */

/* ---- Page layout ------------------------------------------------------ */
.va-auth-page {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem var(--va-gutter, 1.5rem);
  background: linear-gradient(168deg, #e8f0ff 0%, #f1f5f9 40%, var(--va-bg, #fff) 100%);
  position: relative;
  overflow: hidden;
}

/* Subtle grid pattern overlay */
.va-auth-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(17,102,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17,102,255,.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

/* ---- Auth card -------------------------------------------------------- */
.va-auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  box-shadow:
    0 1px 3px rgba(0,0,0,.06),
    0 8px 32px rgba(17,102,255,.06);
  padding: 2.5rem 2rem 2rem;
  z-index: 1;
}

@media (min-width: 480px) {
  .va-auth-card { padding: 2.75rem 2.5rem 2.25rem; }
}

/* ---- Logo block ------------------------------------------------------- */
.va-auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  margin-bottom: 1.75rem;
  text-decoration: none;
  color: var(--va-fg, #1e293b);
}
.va-auth-logo svg {
  flex-shrink: 0;
}
.va-auth-logo-text {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.01em;
  font-family: var(--va-font-sans, 'Inter', system-ui, sans-serif);
}

/* ---- Headings --------------------------------------------------------- */
.va-auth-heading {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--va-fg, #1e293b);
  text-align: center;
  margin: 0 0 .35rem;
  letter-spacing: -.02em;
  line-height: 1.3;
}
.va-auth-subtitle {
  font-size: .875rem;
  color: var(--va-muted, #64748b);
  text-align: center;
  margin: 0 0 1rem;
  line-height: 1.5;
}

.va-auth-value-props {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .375rem;
  font-size: .8125rem;
  color: var(--va-muted, #64748b);
}
.va-auth-value-props li::before {
  content: "\2713  ";
  color: var(--va-green, #22c55e);
  font-weight: 700;
}

/* ---- Form fields ------------------------------------------------------ */
.va-auth-field {
  margin-bottom: 1rem;
}
.va-auth-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--va-fg, #1e293b);
  margin-bottom: .35rem;
  letter-spacing: .01em;
}
.va-auth-input {
  display: block;
  width: 100%;
  padding: .65rem .85rem;
  font-size: .9rem;
  font-family: inherit;
  color: var(--va-fg, #1e293b);
  background: var(--va-surface, #f8fafc);
  border: 1.5px solid var(--va-border, #e2e8f0);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.va-auth-input:focus {
  border-color: var(--va-brand, #1166ff);
  box-shadow: 0 0 0 3px rgba(17,102,255,.1);
  background: #fff;
}
.va-auth-input::placeholder {
  color: #94a3b8;
}
.va-auth-input.is-error {
  border-color: var(--va-red, #ef4444);
  box-shadow: 0 0 0 3px rgba(239,68,68,.08);
}

/* Password wrapper with toggle */
.va-auth-pw-wrap {
  position: relative;
}
.va-auth-pw-wrap .va-auth-input {
  padding-right: 3rem;
}
.va-auth-pw-toggle {
  position: absolute;
  right: .6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--va-muted, #64748b);
  cursor: pointer;
  padding: .25rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  font-family: inherit;
}
.va-auth-pw-toggle:hover {
  color: var(--va-brand, #1166ff);
}

/* ---- Password requirements checklist ---------------------------------- */
.va-auth-pw-reqs {
  list-style: none;
  margin: .5rem 0 1rem;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .3rem .75rem;
}
.va-auth-pw-req {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .75rem;
  color: var(--va-muted, #64748b);
  transition: color .2s;
}
.va-auth-pw-req.is-met {
  color: var(--va-green, #22c55e);
}
.va-auth-pw-req-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, border-color .2s;
}
.va-auth-pw-req.is-met .va-auth-pw-req-icon {
  background: var(--va-green, #22c55e);
  border-color: var(--va-green, #22c55e);
}
.va-auth-pw-req.is-met .va-auth-pw-req-icon svg {
  display: block;
}
.va-auth-pw-req-icon svg {
  display: none;
  width: 8px;
  height: 8px;
}

/* ---- Buttons ---------------------------------------------------------- */
.va-auth-btn {
  display: block;
  width: 100%;
  padding: .7rem 1.25rem;
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--va-brand, #1166ff);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  letter-spacing: .01em;
  margin-top: .5rem;
}
.va-auth-btn:hover {
  background: #0d52cc;
  box-shadow: 0 4px 12px rgba(17,102,255,.25);
}
.va-auth-btn:active {
  transform: scale(.985);
}
.va-auth-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ---- Error display ---------------------------------------------------- */
.va-auth-error {
  padding: .75rem 1rem;
  border-radius: 10px;
  border: 1.5px solid rgba(239,68,68,.25);
  background: #fef2f2;
  color: #991b1b;
  font-size: .8rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}
.va-auth-error[hidden] { display: none; }

/* ---- Success display -------------------------------------------------- */
.va-auth-success {
  padding: .75rem 1rem;
  border-radius: 10px;
  border: 1.5px solid rgba(34,197,94,.25);
  background: #f0fdf4;
  color: #166534;
  font-size: .8rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  text-align: center;
}

/* ---- Divider ---------------------------------------------------------- */
.va-auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
  color: var(--va-muted, #64748b);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 500;
}
.va-auth-divider::before,
.va-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--va-border, #e2e8f0);
}

/* ---- Links ------------------------------------------------------------ */
.va-auth-links {
  text-align: center;
  margin-top: 1.25rem;
  font-size: .85rem;
  color: var(--va-muted, #64748b);
}
.va-auth-links a {
  color: var(--va-brand, #1166ff);
  text-decoration: none;
  font-weight: 500;
}
.va-auth-links a:hover {
  text-decoration: underline;
}
.va-auth-back {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-top: 1rem;
  font-size: .85rem;
  color: var(--va-muted, #64748b);
  text-decoration: none;
}
.va-auth-back:hover { color: var(--va-brand, #1166ff); }

/* ---- Trust signal ----------------------------------------------------- */
.va-auth-trust {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--va-border, #e2e8f0);
  font-size: .75rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
}
.va-auth-trust svg { opacity: .5; }

/* ---- Verify code section (appears after signup) ----------------------- */
.va-auth-verify {
  text-align: center;
}
.va-auth-code-input {
  display: block;
  width: 100%;
  max-width: 220px;
  margin: 1rem auto;
  padding: .7rem 1rem;
  font-size: 1.25rem;
  font-family: var(--va-font-mono, 'SF Mono', monospace);
  letter-spacing: .35em;
  text-align: center;
  border: 1.5px solid var(--va-border, #e2e8f0);
  border-radius: 10px;
  background: var(--va-surface, #f8fafc);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.va-auth-code-input:focus {
  border-color: var(--va-brand, #1166ff);
  box-shadow: 0 0 0 3px rgba(17,102,255,.1);
  background: #fff;
}

/* ---- Loading spinner -------------------------------------------------- */
.va-auth-btn .va-auth-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: va-auth-spin .6s linear infinite;
  vertical-align: middle;
  margin-right: .4rem;
}
@keyframes va-auth-spin {
  to { transform: rotate(360deg); }
}

/* ---- Animations ------------------------------------------------------- */
@keyframes va-auth-fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.va-auth-card {
  animation: va-auth-fadeIn .35s ease-out;
}

/* ---- Verify Success --------------------------------------------------- */
.va-verify-success {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--va-radius, 8px);
  color: #166534;
  font-weight: 500;
  animation: va-auth-fadeIn .35s ease-out;
}

/* ---- Print ------------------------------------------------------------ */
@media print { .va-auth-page { display: none; } }
