/* ============================================================
   auth.css — Builder CVCR
   Estilos compartidos para Login, Registro, Recuperar contraseña
   ============================================================ */

:root {
  --primary:       #2563eb;
  --primary-dark:  #1d4ed8;
  --primary-light: #dbeafe;
  --accent:        #f59e0b;
  --accent-dark:   #d97706;
  --success:       #22c55e;
  --danger:        #ef4444;
  --text:          #0f172a;
  --text-muted:    #64748b;
  --border:        #e2e8f0;
  --bg-soft:       #f8fafc;
  --brand-dark:    #0f172a;
  --brand-grad:    linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 50%, #2563eb 100%);
  --radius:        12px;
  --shadow:        0 4px 24px rgba(0,0,0,.08);
  --shadow-lg:     0 12px 48px rgba(0,0,0,.14);
  --font:          'Plus Jakarta Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body.auth-body {
  font-family: var(--font);
  background: var(--bg-soft);
  color: var(--text);
  min-height: 100vh;
}

/* ─── Layout principal ─────────────────────────────────────── */
.auth-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ─── Panel Izquierdo — Branding ───────────────────────────── */
.auth-brand {
  position: relative;
  flex: 0 0 46%;
  background: var(--brand-grad);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 48px;
}

.auth-brand-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Logo */
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-bottom: 56px;
}
.brand-logo-mobile {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.logo-icon {
  width: 40px; height: 40px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  backdrop-filter: blur(8px);
}
.brand-logo .logo-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: rgba(255,255,255,.9);
  letter-spacing: -.02em;
}
.brand-logo .logo-text strong { color: #fff; font-weight: 800; }
.brand-logo-mobile .logo-icon { background: var(--primary); border-color: var(--primary-dark); }
.brand-logo-mobile .logo-text { font-size: 1.15rem; color: var(--text); font-weight: 600; }
.brand-logo-mobile .logo-text strong { color: var(--primary); }

/* Contenido branding */
.brand-content { flex: 1; }
.brand-content h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: rgba(255,255,255,.9);
  line-height: 1.2;
  letter-spacing: -.03em;
  margin-bottom: 16px;
}
.brand-content .text-accent { color: var(--accent); }
.brand-content p {
  color: rgba(255,255,255,.7);
  font-size: .95rem;
  line-height: 1.6;
  margin-bottom: 32px;
}

/* Features list */
.brand-features { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.brand-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.85);
  font-size: .9rem;
}
.brand-features li i { color: var(--accent); font-size: 1rem; flex-shrink: 0; }

/* Steps (para registro) */
.brand-steps { display: flex; flex-direction: column; gap: 20px; }
.step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.step-num {
  width: 32px; height: 32px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  margin-top: 2px;
}
.step strong { display: block; color: #fff; font-size: .9rem; margin-bottom: 2px; }
.step p { color: rgba(255,255,255,.6); font-size: .82rem; }

/* Footer branding */
.brand-footer {
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,.12);
}
.brand-footer p { color: rgba(255,255,255,.6); font-size: .88rem; }
.brand-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.brand-footer a:hover { text-decoration: underline; }

/* Formas decorativas de fondo */
.brand-bg-shapes { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  filter: blur(1px);
}
.shape-1 { width: 380px; height: 380px; bottom: -100px; right: -80px; }
.shape-2 { width: 220px; height: 220px; top: -60px; right: 40px; background: rgba(245,158,11,.1); }
.shape-3 { width: 120px; height: 120px; bottom: 140px; left: 30px; background: rgba(255,255,255,.08); }

/* ─── Panel Derecho — Formulario ───────────────────────────── */
.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  overflow-y: auto;
}

.auth-form-inner {
  width: 100%;
  max-width: 440px;
}

/* ─── Header del formulario ────────────────────────────────── */
.auth-header {
  margin-bottom: 28px;
}
.auth-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
  margin-bottom: 6px;
}
.auth-header p {
  color: var(--text-muted);
  font-size: .92rem;
}
.auth-icon-wrap {
  width: 56px; height: 56px;
  background: var(--primary-light);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 16px;
}

/* ─── Botón Google ─────────────────────────────────────────── */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-family: var(--font);
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.btn-google:hover {
  border-color: #adb5bd;
  background: #f9fafb;
  box-shadow: var(--shadow);
  color: var(--text);
}

/* ─── Divisor ──────────────────────────────────────────────── */
.divider-or {
  position: relative;
  text-align: center;
  margin: 4px 0 20px;
}
.divider-or::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
.divider-or span {
  position: relative;
  background: var(--bg-soft);
  padding: 0 12px;
  font-size: .8rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ─── Campos del formulario ────────────────────────────────── */
.form-control {
  border: 1.5px solid var(--border);
  border-radius: var(--radius) !important;
  font-family: var(--font);
  font-size: .92rem;
  padding: 12px 16px;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
  background: #fff;
}
.form-floating > label {
  font-size: .88rem;
  color: var(--text-muted);
  padding: 14px 16px;
}
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
  color: var(--primary);
  font-size: .78rem;
}

/* ─── Grupo contraseña con toggle ──────────────────────────── */
.password-group { position: relative; }
.btn-toggle-pass {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 1rem;
  z-index: 10;
  transition: color .2s;
}
.btn-toggle-pass:hover { color: var(--primary); }

/* ─── Indicador fortaleza contraseña ───────────────────────── */
.password-strength {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 2px;
}
.strength-track {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .3s, background .3s;
  width: 0;
}
.strength-label { font-size: .78rem; font-weight: 600; min-width: 70px; }

/* ─── Links ────────────────────────────────────────────────── */
.link-forgot {
  font-size: .85rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.link-forgot:hover { text-decoration: underline; }
.link-back {
  font-size: .88rem;
  color: var(--text-muted);
  text-decoration: none;
}
.link-back:hover { color: var(--primary); }

/* ─── Botón submit principal ───────────────────────────────── */
.btn-auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, transform .15s, box-shadow .2s;
  letter-spacing: -.01em;
}
.btn-auth-submit:hover {
  background: var(--primary-dark);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37,99,235,.35);
  transform: translateY(-1px);
}
.btn-auth-submit:active { transform: translateY(0); }

/* ─── Footer del formulario ────────────────────────────────── */
.auth-footer-link {
  text-align: center;
  margin-top: 24px;
  font-size: .88rem;
  color: var(--text-muted);
}
.auth-footer-link a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.auth-footer-link a:hover { text-decoration: underline; }

/* ─── Alertas ──────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius);
  font-size: .88rem;
  border-width: 1.5px;
  margin-bottom: 20px;
}
.alert-danger  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }

/* ─── Modo centrado (recuperar, nueva contraseña) ──────────── */
.auth-wrapper-centered {
  justify-content: center;
  align-items: center;
  background: var(--bg-soft);
}
.auth-card-solo {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 460px;
  text-align: center;
}
.auth-card-solo .auth-header { text-align: center; }
.auth-card-solo form { text-align: left; }

/* ─── Estado éxito ─────────────────────────────────────────── */
.auth-success-state, .auth-error-state { text-align: center; padding: 12px 0; }
.success-icon-wrap, .error-icon-wrap {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin: 0 auto 20px;
}
.success-icon-wrap { background: #dcfce7; color: var(--success); }
.error-icon-wrap   { background: #fee2e2; color: var(--danger); }
.auth-success-state h2, .auth-error-state h2 {
  font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; letter-spacing: -.02em;
}
.auth-success-state p, .auth-error-state p { color: var(--text-muted); font-size: .92rem; }

/* ─── Responsive ───────────────────────────────────────────── */
@media (max-width: 991px) {
  .auth-form-panel { padding: 32px 20px; }
}
@media (max-width: 575px) {
  .auth-form-inner { max-width: 100%; }
  .auth-card-solo  { padding: 32px 24px; margin: 16px; }
  .auth-header h1  { font-size: 1.5rem; }
}
