/*
 * auth.css — Scoped exclusively to body.vh-auth-public
 * Phase 8.3: Minimal Premium Auth Card Redesign
 * No rules here bleed into authenticated shell, admin, VerifyFlow, or marketing.
 */

/* ─────────────────────────────────────────────
   Variables
───────────────────────────────────────────── */
body.vh-auth-public {
  --auth-blue:          #1a56db;
  --auth-blue-dark:     #1447b8;
  --auth-blue-glow:     rgba(26, 86, 219, 0.18);
  --auth-surface:       #f4f6fb;
  --auth-card-bg:       #ffffff;
  --auth-border:        #e2e8f0;
  --auth-border-light:  rgba(226, 232, 240, 0.8);
  --auth-text:          #0d1b2e;
  --auth-text-muted:    #64748b;
  --auth-input-bg:      #ffffff;
  --auth-input-border:  #cbd5e1;
  --auth-input-focus:   #1a56db;
  --auth-green:         #16a34a;
  --auth-green-dim:     #15803d;
  --auth-radius:        22px;
  --auth-radius-sm:     10px;
  --auth-shadow:        0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -1px rgba(0,0,0,0.04);
  --auth-shadow-card:   0 8px 40px rgba(0, 0, 0, 0.10), 0 2px 8px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(226, 232, 240, 0.8);

  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--auth-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;

  /* Premium light background with soft blue radial glow */
  background-color: var(--auth-surface);
  background-image:
    radial-gradient(ellipse 80% 60% at 15% 10%, rgba(26, 86, 219, 0.10) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 85% 85%, rgba(99, 149, 255, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(255,255,255,0.90) 0%, transparent 70%);
}

/* Very faint dot grid pattern overlay */
body.vh-auth-public::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(15, 40, 100, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

/* ─────────────────────────────────────────────
   Flash messages
───────────────────────────────────────────── */
body.vh-auth-public .vh-auth-flashes {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
}

body.vh-auth-public .vh-auth-flashes .alert {
  border-radius: 0;
  margin: 0;
  border: none;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  font-size: 0.875rem;
  padding: 10px 24px;
}

/* ─────────────────────────────────────────────
   Centered canvas
───────────────────────────────────────────── */
body.vh-auth-public .vh-auth-canvas {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  min-height: 100vh;
}

/* ─────────────────────────────────────────────
   Auth card
───────────────────────────────────────────── */
body.vh-auth-public .vh-auth-card {
  background: var(--auth-card-bg);
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-shadow-card);
  border: 1px solid var(--auth-border-light);
  width: 100%;
  max-width: 440px;
  padding: 36px 40px 32px;
  position: relative;
}

body.vh-auth-public .vh-auth-card--wide {
  max-width: 490px;
}

/* ─────────────────────────────────────────────
   Logo
───────────────────────────────────────────── */
body.vh-auth-public .vh-auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

body.vh-auth-public .vh-auth-logo a {
  display: inline-block;
  line-height: 0;
}

body.vh-auth-public .vh-auth-logo__img {
  height: 34px;
  width: auto;
  display: block;
  margin: 0 auto;
}

/* ─────────────────────────────────────────────
   Card heading
───────────────────────────────────────────── */
body.vh-auth-public .vh-auth-card__title {
  font-size: 1.45rem;
  font-weight: 750;
  color: var(--auth-text);
  margin: 0 0 5px;
  letter-spacing: -0.025em;
  text-align: center;
}

body.vh-auth-public .vh-auth-card__subtitle {
  font-size: 0.9rem;
  color: var(--auth-text-muted);
  margin: 0 0 24px;
  line-height: 1.55;
  text-align: center;
}

/* Secondary page small icon (lock/mail/key — NOT shield/check) */
body.vh-auth-public .vh-auth-card__icon {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, rgba(26, 86, 219, 0.10), rgba(26, 86, 219, 0.05));
  border: 1px solid rgba(26, 86, 219, 0.14);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--auth-blue);
  font-size: 1.15rem;
  margin: 0 auto 20px;
  box-shadow: 0 2px 8px rgba(26, 86, 219, 0.09);
}

/* ─────────────────────────────────────────────
   OAuth social buttons
───────────────────────────────────────────── */
body.vh-auth-public .vh-auth-social {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

body.vh-auth-public .vh-auth-social--col {
  flex-direction: column;
}

body.vh-auth-public .vh-auth-social__btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 12px;
  min-height: 40px;
  border: 1px solid var(--auth-input-border);
  border-radius: var(--auth-radius-sm);
  background: var(--auth-card-bg);
  color: var(--auth-text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.14s, border-color 0.14s, box-shadow 0.14s, transform 0.1s;
  cursor: pointer;
  white-space: nowrap;
}

body.vh-auth-public .vh-auth-social__btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  box-shadow: 0 2px 6px rgba(0,0,0,0.07);
  color: var(--auth-text);
  transform: translateY(-1px);
}

body.vh-auth-public .vh-auth-social__btn:active {
  transform: translateY(0);
}

body.vh-auth-public .vh-auth-social__btn--sso {
  border-color: rgba(26, 86, 219, 0.28);
  color: var(--auth-blue);
}

body.vh-auth-public .vh-auth-social__btn--sso:hover {
  background: rgba(26, 86, 219, 0.04);
  border-color: var(--auth-blue);
  color: var(--auth-blue);
}

/* Full-width SSO row */
body.vh-auth-public .vh-auth-sso-row {
  margin-bottom: 14px;
}

body.vh-auth-public .vh-auth-sso-row .vh-auth-social__btn {
  width: 100%;
  min-height: 40px;
  display: flex;
}

/* ─────────────────────────────────────────────
   Divider
───────────────────────────────────────────── */
body.vh-auth-public .vh-auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 16px;
  color: var(--auth-text-muted);
  font-size: 0.795rem;
}

body.vh-auth-public .vh-auth-divider::before,
body.vh-auth-public .vh-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--auth-border);
}

/* ─────────────────────────────────────────────
   Form groups + inputs
───────────────────────────────────────────── */
body.vh-auth-public .vh-auth-form-group {
  margin-bottom: 14px;
}

body.vh-auth-public .vh-auth-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--auth-text);
  margin-bottom: 5px;
}

body.vh-auth-public .vh-auth-input {
  display: block;
  width: 100%;
  padding: 9px 13px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--auth-text);
  background: var(--auth-input-bg);
  border: 1px solid var(--auth-input-border);
  border-radius: var(--auth-radius-sm);
  transition: border-color 0.14s, box-shadow 0.14s;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
  -webkit-appearance: none;
  min-height: 42px;
}

body.vh-auth-public .vh-auth-input:focus {
  border-color: var(--auth-input-focus);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.11);
}

body.vh-auth-public .vh-auth-input::placeholder {
  color: #b0bec5;
}

/* Input with left icon */
body.vh-auth-public .vh-auth-input-wrap {
  position: relative;
}

body.vh-auth-public .vh-auth-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #b0bec5;
  font-size: 0.8rem;
  pointer-events: none;
  z-index: 1;
}

body.vh-auth-public .vh-auth-input--icon {
  padding-left: 36px;
}

body.vh-auth-public .vh-auth-input--icon-r {
  padding-right: 40px;
}

body.vh-auth-public .vh-auth-toggle-pw {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 4px 5px;
  font-size: 0.82rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.14s;
}

body.vh-auth-public .vh-auth-toggle-pw:hover {
  color: var(--auth-text-muted);
}

/* Large centered code input (2FA) */
body.vh-auth-public .vh-auth-input--lg {
  padding: 12px 14px;
  font-size: 1.35rem;
  text-align: center;
  letter-spacing: 0.35em;
  font-weight: 600;
  min-height: 52px;
}

body.vh-auth-public .vh-auth-input-hint {
  font-size: 0.785rem;
  color: var(--auth-text-muted);
  margin-top: 4px;
}

body.vh-auth-public .vh-auth-input-hint.is-success { color: var(--auth-green-dim); }
body.vh-auth-public .vh-auth-input-hint.is-warning { color: #b45309; }
body.vh-auth-public .vh-auth-input-hint.is-danger  { color: #dc2626; }

/* Two-column name row */
body.vh-auth-public .vh-auth-name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

/* Password label row (label + forgot link) */
body.vh-auth-public .vh-auth-pw-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

body.vh-auth-public .vh-auth-pw-row .vh-auth-label {
  margin-bottom: 0;
}

body.vh-auth-public .vh-auth-forgot-link {
  font-size: 0.8125rem;
  color: var(--auth-blue);
  text-decoration: none;
  font-weight: 500;
  flex-shrink: 0;
}

body.vh-auth-public .vh-auth-forgot-link:hover {
  text-decoration: underline;
}

/* ─────────────────────────────────────────────
   Remember me / checkbox row
───────────────────────────────────────────── */
body.vh-auth-public .vh-auth-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

body.vh-auth-public .vh-auth-check-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--auth-blue);
  flex-shrink: 0;
  cursor: pointer;
}

body.vh-auth-public .vh-auth-check-row label {
  font-size: 0.875rem;
  color: var(--auth-text-muted);
  cursor: pointer;
  line-height: 1.4;
}

body.vh-auth-public .vh-auth-check-row label a {
  color: var(--auth-blue);
  text-decoration: none;
}

body.vh-auth-public .vh-auth-check-row label a:hover {
  text-decoration: underline;
}

/* ─────────────────────────────────────────────
   Primary CTA button
───────────────────────────────────────────── */
body.vh-auth-public .vh-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--auth-radius-sm);
  border: none;
  cursor: pointer;
  transition: background 0.14s, box-shadow 0.14s, opacity 0.14s, transform 0.1s;
  font-family: inherit;
  text-decoration: none;
  line-height: 1.4;
  min-height: 44px;
}

body.vh-auth-public .vh-auth-btn--primary {
  background: var(--auth-blue);
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(26, 86, 219, 0.30);
}

body.vh-auth-public .vh-auth-btn--primary .vh-btn-text {
  flex: 1;
  text-align: center;
}

body.vh-auth-public .vh-auth-btn--primary:hover {
  background: var(--auth-blue-dark);
  box-shadow: 0 4px 14px rgba(26, 86, 219, 0.38);
  color: #ffffff;
  transform: translateY(-1px);
}

body.vh-auth-public .vh-auth-btn--primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(26, 86, 219, 0.20);
}

body.vh-auth-public .vh-auth-btn--primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

body.vh-auth-public .vh-auth-btn--ghost {
  background: transparent;
  color: var(--auth-blue);
  border: 1px solid rgba(26, 86, 219, 0.30);
  justify-content: center;
}

body.vh-auth-public .vh-auth-btn--ghost:hover {
  background: rgba(26, 86, 219, 0.05);
  border-color: var(--auth-blue);
  color: var(--auth-blue);
}

body.vh-auth-public .vh-auth-btn--link {
  background: transparent;
  color: var(--auth-text-muted);
  width: auto;
  padding: 4px 0;
  font-weight: 400;
  font-size: 0.875rem;
  justify-content: center;
  min-height: unset;
}

body.vh-auth-public .vh-auth-btn--link:hover {
  color: var(--auth-text);
}

/* ─────────────────────────────────────────────
   Footer row inside the card
───────────────────────────────────────────── */
body.vh-auth-public .vh-auth-card__footer {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--auth-border);
  text-align: center;
}

body.vh-auth-public .vh-auth-card__footer p {
  font-size: 0.875rem;
  color: var(--auth-text-muted);
  margin: 0 0 6px;
}

body.vh-auth-public .vh-auth-card__footer p:last-child {
  margin-bottom: 0;
}

body.vh-auth-public .vh-auth-card__footer a {
  color: var(--auth-blue);
  text-decoration: none;
  font-weight: 600;
}

body.vh-auth-public .vh-auth-card__footer a:hover {
  text-decoration: underline;
}

body.vh-auth-public .vh-auth-card__footer a.vh-footer-link-arrow::after {
  content: " →";
  font-weight: 600;
}

/* ─────────────────────────────────────────────
   Flash / alert messages inside the card
───────────────────────────────────────────── */
body.vh-auth-public .vh-auth-alert {
  border-radius: var(--auth-radius-sm);
  padding: 11px 13px;
  font-size: 0.875rem;
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.5;
  border: 1px solid transparent;
}

body.vh-auth-public .vh-auth-alert--info {
  background: rgba(26, 86, 219, 0.06);
  border-color: rgba(26, 86, 219, 0.18);
  color: #1e3a8a;
}

body.vh-auth-public .vh-auth-alert--success {
  background: rgba(22, 163, 74, 0.06);
  border-color: rgba(22, 163, 74, 0.25);
  color: #14532d;
}

body.vh-auth-public .vh-auth-alert--warning {
  background: rgba(180, 83, 9, 0.07);
  border-color: rgba(180, 83, 9, 0.25);
  color: #78350f;
}

body.vh-auth-public .vh-auth-alert--danger,
body.vh-auth-public .vh-auth-alert--error {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.18);
  color: #7f1d1d;
}

body.vh-auth-public .vh-auth-alert i {
  flex-shrink: 0;
  margin-top: 2px;
}

/* Bootstrap flash compatibility */
body.vh-auth-public .alert {
  font-size: 0.875rem;
  border-radius: var(--auth-radius-sm);
}

/* ─────────────────────────────────────────────
   Verification sent checklist
───────────────────────────────────────────── */
body.vh-auth-public .vh-auth-checklist {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.vh-auth-public .vh-auth-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--auth-text-muted);
}

body.vh-auth-public .vh-auth-checklist__num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(26, 86, 219, 0.10);
  border: 1px solid rgba(26, 86, 219, 0.18);
  color: var(--auth-blue);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

body.vh-auth-public .vh-auth-checklist__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

body.vh-auth-public .vh-auth-checklist__body strong {
  color: var(--auth-text);
  font-weight: 600;
  font-size: 0.875rem;
}

body.vh-auth-public .vh-auth-checklist__body span {
  font-size: 0.8125rem;
  color: var(--auth-text-muted);
}

/* ─────────────────────────────────────────────
   Spinner animation
───────────────────────────────────────────── */
body.vh-auth-public .vh-spin {
  animation: vh-spin-kf 0.7s linear infinite;
}

@keyframes vh-spin-kf {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ─────────────────────────────────────────────
   Mobile
───────────────────────────────────────────── */
@media (max-width: 540px) {
  body.vh-auth-public .vh-auth-canvas {
    padding: 24px 16px;
    align-items: flex-start;
    padding-top: 32px;
  }

  body.vh-auth-public .vh-auth-card {
    max-width: 100%;
    padding: 28px 22px 24px;
    border-radius: 18px;
  }

  body.vh-auth-public .vh-auth-card--wide {
    max-width: 100%;
  }

  body.vh-auth-public .vh-auth-name-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  body.vh-auth-public .vh-auth-name-row .vh-auth-form-group:first-child {
    margin-bottom: 14px;
  }

  body.vh-auth-public .vh-auth-logo__img {
    height: 30px;
  }

  body.vh-auth-public .vh-auth-social {
    gap: 7px;
  }

  body.vh-auth-public .vh-auth-social__btn {
    font-size: 0.8rem;
    gap: 5px;
    padding: 8px 10px;
  }
}

@media (max-width: 380px) {
  body.vh-auth-public .vh-auth-card {
    padding: 24px 18px 20px;
    border-radius: 16px;
  }
}
