/* =========================================================
   login.css — Email Service Dashboard
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:      #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light:#eff6ff;
  --success:      #16a34a;
  --error:        #dc2626;
  --error-light:  #fef2f2;
  --warning:      #d97706;
  --text:         #111827;
  --text-muted:   #6b7280;
  --border:       #e5e7eb;
  --bg:           #f9fafb;
  --card:         #ffffff;
  --radius:       12px;
  --shadow:       0 4px 24px rgba(0,0,0,.08);
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  color: var(--text);
}

/* ─── Card ──────────────────────────────────────────────── */
.login-container {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
}

/* ─── Header ─────────────────────────────────────────────── */
.login-header { text-align: center; margin-bottom: 2rem; }

.logo {
  font-size: 2.5rem;
  margin-bottom: .75rem;
  display: inline-block;
  filter: drop-shadow(0 2px 6px rgba(37,99,235,.25));
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .25rem;
}

.login-subtitle {
  font-size: .875rem;
  color: var(--text-muted);
}

/* ─── Indicador de pasos ─────────────────────────────────── */
.step-indicator {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin-bottom: 1.75rem;
}

.step {
  width: 2rem;
  height: .375rem;
  border-radius: 99px;
  background: var(--border);
  transition: background .3s, transform .3s;
}

.step.active {
  background: var(--primary);
  transform: scaleX(1.15);
}

/* ─── Alertas ─────────────────────────────────────────────── */
#alert-container { margin-bottom: 1rem; }

.alert {
  padding: .875rem 1rem;
  border-radius: 8px;
  font-size: .875rem;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  animation: slideIn .25s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }
.alert-error   { background: var(--error-light); color: var(--error); border: 1px solid #fecaca; }
.alert-info    { background: var(--primary-light); color: var(--primary); border: 1px solid #bfdbfe; }

/* ─── Formulario ─────────────────────────────────────────── */
.login-form { display: flex; flex-direction: column; gap: 1.25rem; }
.hidden     { display: none !important; }

.form-group { display: flex; flex-direction: column; gap: .375rem; }

.form-label {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
}

.form-input {
  padding: .75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  background: #fff;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.form-input.error { border-color: var(--error); }

.form-help {
  font-size: .75rem;
  color: var(--text-muted);
}

/* ─── OTP inputs ─────────────────────────────────────────── */
.otp-inputs {
  display: flex;
  gap: .5rem;
  justify-content: center;
}

.otp-input {
  width: 3rem;
  height: 3.25rem;
  text-align: center;
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: .05em;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, transform .15s;
  background: #fff;
}

.otp-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
  transform: translateY(-2px);
}

.otp-input.filled  { border-color: var(--primary); background: var(--primary-light); }
.otp-input.error   { border-color: var(--error); background: var(--error-light); }

/* ─── Countdown ──────────────────────────────────────────── */
.countdown {
  text-align: center;
  font-size: .8125rem;
  color: var(--text-muted);
}

.countdown.expiring { color: var(--warning); font-weight: 500; }
.countdown.expired  { color: var(--error);   font-weight: 500; }

/* ─── Botones ─────────────────────────────────────────────── */
.btn-primary {
  padding: .8125rem 1rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .2s, transform .15s, box-shadow .2s;
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(37,99,235,.3);
}

.btn-primary:active:not(:disabled) { transform: scale(.98); }

.btn-primary:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.btn-primary.loading {
  position: relative;
  color: transparent;
}

.btn-primary.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: .875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  width: 100%;
  padding: .25rem;
  transition: color .2s;
}

.btn-link:hover:not(:disabled) { color: var(--primary-dark); text-decoration: underline; }
.btn-link:disabled { color: var(--text-muted); cursor: not-allowed; text-decoration: none; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .login-container { padding: 2rem 1.25rem; }
  .otp-input { width: 2.6rem; height: 3rem; font-size: 1.25rem; }
}
