/* ── TaskFlow Auth CSS ──────────────────────────────────────── */
:root {
  --primary:        #1A3A6B;
  --primary-light:  #2557A7;
  --primary-dark:   #0F2347;
  --accent:         #0EA5E9;
  --accent2:        #38BDF8;
  --success:        #10B981;
  --danger:         #EF4444;
  --warning:        #F59E0B;
  --surface:        #F0F4FA;
  --border:         #C7D7EF;
  --text:           #1E2D45;
  --text-muted:     #5A7499;
  --card:           #FFFFFF;
  --font-head:      'Syne', sans-serif;
  --font-body:      'DM Sans', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body.auth-body {
  font-family: var(--font-body);
  background: var(--primary-dark);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 0;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Decorative background blobs */
.auth-body::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(14,165,233,0.15) 0%, transparent 70%);
  top: -150px; right: -150px;
  pointer-events: none;
}
.auth-body::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(37,87,167,0.2) 0%, transparent 70%);
  bottom: -100px; left: -100px;
  pointer-events: none;
}

/* ── Auth Container ──────────────────────────────────────── */
.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  padding: 16px;
}

.auth-card {
  background: var(--card);
  border-radius: 16px;
  padding: 40px 36px 36px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
}

/* ── Brand ───────────────────────────────────────────────── */
.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}
.auth-brand-mark {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-weight: 800; font-size: 20px;
  color: #fff;
  letter-spacing: -1px;
  box-shadow: 0 4px 16px rgba(26,58,107,0.4);
  flex-shrink: 0;
}
.auth-brand-text { display: flex; flex-direction: column; }
.auth-brand-name {
  font-family: var(--font-head);
  font-weight: 800; font-size: 22px;
  color: var(--primary); letter-spacing: -0.5px;
}
.auth-brand-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

/* ── Form Heading ────────────────────────────────────────── */
.auth-title {
  font-family: var(--font-head);
  font-size: 20px; font-weight: 700;
  color: var(--text); margin-bottom: 4px;
}
.auth-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }

/* ── Form Fields ─────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 12.5px; font-weight: 600;
  color: var(--text-muted); letter-spacing: .4px;
  text-transform: uppercase; margin-bottom: 6px;
}
.input-wrap { position: relative; }
.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14.5px; color: var(--text);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.12);
}
.form-input.is-invalid { border-color: var(--danger); }
.form-input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.12); }

/* Password toggle */
.input-wrap .pw-toggle {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 16px; padding: 2px;
  line-height: 1;
}

/* Field hint (tenant code) */
.form-hint {
  font-size: 11.5px; color: var(--text-muted);
  margin-top: 5px; display: flex; align-items: center; gap: 4px;
}

/* Validation errors */
.field-error { font-size: 12px; color: var(--danger); margin-top: 5px; display: block; }
.field-error::before { content: '* '; }

/* ── Alert Boxes ─────────────────────────────────────────── */
.auth-alert {
  padding: 12px 16px; border-radius: 8px;
  font-size: 13.5px; margin-bottom: 20px;
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid;
}
.auth-alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.auth-alert.error   { background: #FFF1F2; border-color: #FECACA; color: #991B1B; }
.auth-alert.success { background: #F0FDF4; border-color: #BBF7D0; color: #065F46; }
.auth-alert.warning { background: #FFFBEB; border-color: #FDE68A; color: #92400E; }
.auth-alert.info    { background: #EFF6FF; border-color: #BFDBFE; color: #1D4ED8; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff; border: none; border-radius: 8px;
  font-family: var(--font-head); font-weight: 700; font-size: 15px;
  cursor: pointer; transition: all .2s;
  box-shadow: 0 4px 12px rgba(26,58,107,0.3);
  margin-top: 8px;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(26,58,107,0.4);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px;
  background: var(--surface); border: 1.5px solid var(--border);
  color: var(--text); font-family: var(--font-body);
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  text-decoration: none; transition: all .18s;
}
.btn-secondary:hover { background: #E4ECF7; border-color: #A0BCDF; }

/* ── Forgot Password Link ────────────────────────────────── */
.auth-links {
  display: flex; justify-content: space-between;
  align-items: center; margin-top: 16px;
}
.auth-link {
  font-size: 13px; color: var(--primary-light);
  text-decoration: none; font-weight: 500;
}
.auth-link:hover { text-decoration: underline; }

/* ── OTP Input ───────────────────────────────────────────── */
.otp-container { display: flex; gap: 10px; justify-content: center; margin: 20px 0; }
.otp-digit {
  width: 52px; height: 60px;
  text-align: center; font-size: 24px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  border: 2px solid var(--border); border-radius: 10px;
  color: var(--primary); background: var(--surface);
  outline: none; transition: all .2s;
}
.otp-digit:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14,165,233,0.15); background: #fff; }
.otp-timer {
  text-align: center; font-size: 13px; color: var(--text-muted);
  margin-bottom: 6px;
}
.otp-timer span { font-weight: 600; color: var(--primary); font-variant-numeric: tabular-nums; }

/* ── Password Strength ───────────────────────────────────── */
.pw-strength-bar {
  height: 4px; border-radius: 2px;
  background: var(--border); margin-top: 8px;
  overflow: hidden;
}
.pw-strength-fill { height: 100%; border-radius: 2px; transition: width .3s, background .3s; width: 0; }
.pw-strength-label { font-size: 11.5px; margin-top: 4px; color: var(--text-muted); }

/* ── Step indicator (multi-step flow) ────────────────────── */
.auth-steps {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 28px;
}
.step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; font-family: var(--font-head);
  flex-shrink: 0;
}
.step-dot.done  { background: var(--success); color: #fff; }
.step-dot.active{ background: var(--primary); color: #fff; }
.step-dot.todo  { background: var(--border);  color: var(--text-muted); }
.step-line {
  flex: 1; height: 2px;
  background: var(--border);
}
.step-line.done { background: var(--success); }

@media (max-width: 480px) {
  .auth-card { padding: 28px 20px 24px; }
  .otp-digit { width: 42px; height: 52px; font-size: 20px; }
}
