/* WellLife sign-in + two-factor — mirrors the customer-confirmed POC login. */
:root {
  --primary: #8100B6;
  --primary-hover: #6A0096;
  --primary-light: #F3E5F9;
  --surface: #FFFFFF;
  --page-bg: #F6F6F6;
  --border: #E2E8F0;
  --text: #23283D;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --error: #EF4444;
  --radius-card: 12px;
  --radius-btn: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--page-bg);
  font-family: 'Montserrat', 'Aptos', system-ui, -apple-system, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  padding: 44px 36px 36px;
}

.logo-area { text-align: center; margin-bottom: 32px; }
.logo-area img { height: 44px; width: auto; }
.logo-area p { font-size: 13px; color: var(--text-muted); margin: 8px 0 0; }

.env-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #FEF3C7; color: #92400E; font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px; margin-top: 12px;
}
.env-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: #F59E0B; }

.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-btn); font-size: 14px; font-family: inherit;
  color: var(--text); background: var(--surface); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(129, 0, 182, 0.12); }

.form-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.remember { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.remember input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.forgot { font-size: 13px; color: var(--primary); font-weight: 500; text-decoration: none; }
.forgot:hover { text-decoration: underline; }

.btn-login {
  width: 100%; padding: 12px; background: var(--primary); color: #fff; border: none;
  border-radius: var(--radius-btn); font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: background 0.15s, transform 0.15s;
}
.btn-login:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-login:active { transform: translateY(0); }

.alert {
  background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5;
  font-size: 13px; padding: 10px 12px; border-radius: var(--radius-btn);
  margin-bottom: 16px; text-align: center;
}

.footer-text { text-align: center; margin-top: 24px; font-size: 12px; color: var(--text-muted); }
.footer-text a { color: var(--primary); font-weight: 500; text-decoration: none; }
.footer-text a:hover { text-decoration: underline; }

/* two-factor */
.mfa-intro { font-size: 13px; color: var(--text-secondary); text-align: center; margin-bottom: 20px; line-height: 1.5; }
.otp-inputs { display: flex; gap: 8px; justify-content: center; margin-bottom: 8px; }
.otp-digit {
  width: 44px; height: 52px; text-align: center; font-size: 20px; font-weight: 600;
  border: 1px solid var(--border); border-radius: var(--radius-btn); font-family: inherit;
  color: var(--text); background: var(--surface); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.otp-digit:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(129, 0, 182, 0.12); }
.resend, .back-link {
  display: block; text-align: center; text-decoration: none; margin-top: 14px;
  cursor: pointer; background: none; border: none; width: 100%; font-family: inherit;
}
.resend { font-size: 13px; color: var(--primary); font-weight: 500; }
.back-link { font-size: 12px; color: var(--text-muted); margin-top: 16px; }
.resend:hover, .back-link:hover { text-decoration: underline; }

.login-card-wide { max-width: 520px; }
.mfa-title { font-size: 18px; font-weight: 700; text-align: center; margin: 0 0 8px; }
.mfa-steps { font-size: 13px; color: var(--text-secondary); line-height: 1.6; padding-left: 20px; margin: 0 0 20px; }
.mfa-steps li { margin-bottom: 12px; }
.mfa-steps a { color: var(--primary); font-weight: 500; }
.mfa-warning { display: block; color: #991B1B; font-weight: 600; margin-top: 4px; }
.mfa-note { display: block; font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.mfa-qr-wrap { display: flex; justify-content: center; margin: 12px 0; }
.mfa-qr { width: 225px; max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius-btn); }
.setup-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; font-weight: 600;
  letter-spacing: 0.04em; color: var(--text); background: #F3F4F6; border-radius: var(--radius-btn);
  padding: 8px 10px; margin-top: 6px; overflow-wrap: anywhere; user-select: all;
}
.setup-key-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.06em; }
.recovery-codes {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; margin: 0 0 24px;
  padding: 16px 16px 16px 36px; background: #F3F4F6; border-radius: var(--radius-btn);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; font-weight: 600;
}
.btn-link { display: block; text-align: center; text-decoration: none; }

@media (max-width: 480px) { .login-card { padding: 32px 24px 28px; } }
@media (max-width: 360px) {
  .otp-inputs { gap: 4px; }
  .otp-digit { width: 38px; height: 48px; }
  .recovery-codes { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  body { background: #fff; }
  .login-card { box-shadow: none; }
  .btn-link, .footer-text { display: none; }
}
