/* ============================================================
   Auth Modal — Iniciar sesión / Crear cuenta
   Basado en el diseño de Figma ("registro 1")
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700&family=Sora:wght@400;600&display=swap');

:root {
  --auth-primary: #123b82;
  --auth-primary-dark: #0e2f68;
  --auth-overlay: #0b1f3a;
  --auth-soft: #eef4ff;
  --auth-step: #dde9fb;
  --auth-line: #e3e8ef;
  --auth-ink: #1b2430;
  --auth-muted: #5f6b7a;
}

/* ---------- Overlay + posicionamiento ---------- */
.auth-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; }
.auth-modal[hidden] { display: none; }
.auth-modal__overlay { position: absolute; inset: 0; background: rgba(11, 31, 58, .72); backdrop-filter: blur(2px); animation: authFade .2s ease; }

@keyframes authFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes authPop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Tarjeta ---------- */
.auth-card {
  position: relative; width: 100%; max-width: 448px;
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(11, 31, 58, .35);
  animation: authPop .25s ease; max-height: calc(100vh - 40px); display: flex; flex-direction: column;
}
.auth-card__grad { height: 8px; flex-shrink: 0; background: linear-gradient(90deg, #41bf5a, #f4c430, #f0755c, #d70505, #8b5cf6, #0877e8); }
.auth-card__inner { padding: 22px 32px 28px; overflow-y: auto; }

/* ---------- Top: logo + cerrar ---------- */
.auth-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.auth-brand { display: flex; align-items: center; gap: 8px; }
.auth-brand__logo { height: 34px; width: auto; }
.auth-brand span { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 16px; color: var(--auth-primary); }
.auth-close {
  width: 32px; height: 32px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--auth-soft); color: var(--auth-muted); font-size: 15px;
  display: grid; place-items: center; transition: background .15s, color .15s;
}
.auth-close:hover { background: #dfe8fb; color: var(--auth-primary); }

/* ---------- Encabezado del formulario ---------- */
.auth-head { margin-bottom: 20px; }
.auth-head h2 { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 24px; color: var(--auth-ink); }
.auth-head p { font-family: 'Sora', sans-serif; font-size: 14px; color: var(--auth-muted); margin-top: 4px; }

/* ---------- Campos ---------- */
.auth-form { font-family: 'Sora', sans-serif; }
.auth-field { margin-bottom: 15px; }
.auth-field > label { display: block; font-weight: 600; font-size: 14px; color: var(--auth-ink); margin-bottom: 7px; }
.auth-input {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--auth-line); border-radius: 10px; padding: 0 12px; height: 44px;
  background: #fff; transition: border-color .15s, box-shadow .15s;
}
.auth-input:focus-within { border-color: var(--auth-primary); box-shadow: 0 0 0 3px rgba(18, 59, 130, .12); }
.auth-input > i { color: var(--auth-muted); font-size: 15px; width: 18px; text-align: center; }
.auth-input input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-family: 'Sora', sans-serif; font-size: 14px; color: var(--auth-ink); min-width: 0;
}
.auth-input.is-error { border-color: #d70505; box-shadow: 0 0 0 3px rgba(215, 5, 5, .1); }
.auth-eye { border: 0; background: none; cursor: pointer; color: var(--auth-muted); padding: 4px; font-size: 15px; }
.auth-eye:hover { color: var(--auth-primary); }

/* ---------- Fila derecha / links ---------- */
.auth-row-right { text-align: right; margin: -4px 0 16px; }
.auth-link { font-weight: 600; font-size: 12px; color: var(--auth-primary); }
.auth-link:hover { text-decoration: underline; }

/* ---------- Botones ---------- */
.auth-btn {
  width: 100%; height: 48px; border: 0; border-radius: 10px; cursor: pointer;
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: background .15s, transform .1s;
}
.auth-btn:active { transform: translateY(1px); }
.auth-btn--primary { background: var(--auth-primary); color: #fff; }
.auth-btn--primary:hover { background: var(--auth-primary-dark); }
.auth-btn--google { background: #fff; color: var(--auth-ink); border: 1px solid var(--auth-line); font-family: 'Sora', sans-serif; font-weight: 600; font-size: 14px; }
.auth-btn--google:hover { background: #f7f9fc; }
.auth-btn--google .g { font-size: 17px; }

/* ---------- Divisor ---------- */
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--auth-line); }
.auth-divider span { font-family: 'Sora', sans-serif; font-size: 12px; color: var(--auth-muted); }

/* ---------- Cambio login/registro ---------- */
.auth-switch { font-family: 'Sora', sans-serif; text-align: center; font-size: 14px; color: var(--auth-muted); margin-top: 16px; }
.auth-switch a { color: var(--auth-primary); font-weight: 600; cursor: pointer; }
.auth-switch a:hover { text-decoration: underline; }

/* ---------- Indicador de pasos ---------- */
.auth-steps { position: relative; display: flex; justify-content: space-between; margin: 4px 0 22px; }
.auth-steps::before { content: ""; position: absolute; top: 16px; left: 16px; right: 16px; height: 4px; background: var(--auth-step); border-radius: 2px; }
.auth-steps__bar { position: absolute; top: 16px; left: 16px; height: 4px; background: var(--auth-primary); border-radius: 2px; transition: width .3s ease; }
.auth-step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.auth-step__dot {
  width: 32px; height: 32px; border-radius: 50%; background: var(--auth-step); color: var(--auth-muted);
  display: grid; place-items: center; font-family: 'Inter', sans-serif; font-weight: 700; font-size: 14px; transition: background .3s, color .3s;
}
.auth-step.is-active .auth-step__dot, .auth-step.is-done .auth-step__dot { background: var(--auth-primary); color: #fff; }
.auth-step__label { font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 500; color: var(--auth-muted); }
.auth-step.is-active .auth-step__label { color: var(--auth-primary); font-weight: 600; }

/* ---------- Toggle Natural / Empresa ---------- */
.auth-toggle { display: flex; gap: 4px; background: var(--auth-soft); border-radius: 10px; padding: 4px; margin-bottom: 16px; }
.auth-toggle button {
  flex: 1; height: 34px; border: 0; border-radius: 8px; cursor: pointer; background: transparent;
  font-family: 'Inter', sans-serif; font-weight: 500; font-size: 14px; color: var(--auth-muted); transition: background .15s, color .15s, box-shadow .15s;
}
.auth-toggle button.is-active { background: #fff; color: var(--auth-primary); font-weight: 600; box-shadow: 0 1px 3px rgba(11,31,58,.12); }

/* ---------- Checkbox términos ---------- */
.auth-check { display: flex; align-items: flex-start; gap: 9px; font-family: 'Sora', sans-serif; font-size: 12.5px; color: var(--auth-muted); margin: 4px 0 16px; cursor: pointer; line-height: 1.4; }
.auth-check input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--auth-primary); flex-shrink: 0; }
.auth-check a { color: var(--auth-primary); }

/* ---------- Verificación (paso 2) ---------- */
.auth-code { display: flex; gap: 10px; justify-content: center; margin: 8px 0 18px; }
.auth-code input {
  width: 46px; height: 54px; text-align: center; font-family: 'Poppins', sans-serif; font-size: 22px; font-weight: 600;
  border: 1px solid var(--auth-line); border-radius: 10px; outline: 0; color: var(--auth-ink);
}
.auth-code input:focus { border-color: var(--auth-primary); box-shadow: 0 0 0 3px rgba(18,59,130,.12); }

/* ---------- Éxito (paso 3) ---------- */
.auth-done { text-align: center; padding: 14px 0 6px; font-family: 'Sora', sans-serif; }
.auth-done__icon { width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%; background: #e6f7ec; color: #04a115; display: grid; place-items: center; font-size: 38px; }
.auth-done h3 { font-family: 'Poppins', sans-serif; font-size: 22px; color: var(--auth-ink); margin-bottom: 6px; }
.auth-done p { font-size: 14px; color: var(--auth-muted); margin-bottom: 20px; }

.auth-muted-note { font-family: 'Sora', sans-serif; font-size: 13px; color: var(--auth-muted); text-align: center; margin-bottom: 16px; line-height: 1.5; }

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .auth-card__inner { padding: 20px 20px 24px; }
  .auth-head h2 { font-size: 21px; }
  .auth-code input { width: 40px; height: 48px; font-size: 19px; }
}
