/* ── Reset y variables ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:        #6366f1;
  --primary-dark:   #4f46e5;
  --primary-light:  #e0e7ff;
  --success:        #10b981;
  --error:          #ef4444;
  --warning:        #f59e0b;
  --text:           #1e293b;
  --text-muted:     #64748b;
  --border:         #e2e8f0;
  --bg:             #f8fafc;
  --white:          #ffffff;
  --radius:         12px;
  --shadow:         0 4px 24px rgba(0,0,0,.08);
  --transition:     .2s ease;
}

body.auth-page {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  color: var(--text);
}

/* ── Layout dos columnas ─────────────────────────────────────────────────── */
.auth-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 960px;
  width: 100%;
  min-height: 580px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(99,102,241,.15);
}

/* ── Panel izquierdo ─────────────────────────────────────────────────────── */
.auth-panel-left {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  padding: 3rem 2.5rem;
  color: var(--white);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.brand-icon {
  width: 40px; height: 40px;
  background: rgba(255,255,255,.2);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}

.brand-name {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -.3px;
}

.auth-panel-left h1 {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.2;
  margin-top: .5rem;
}

.auth-panel-left p {
  font-size: .95rem;
  opacity: .85;
  line-height: 1.6;
}

.features {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-top: auto;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .9rem;
  opacity: .9;
}

.feature-item i {
  width: 28px; height: 28px;
  background: rgba(255,255,255,.15);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
  flex-shrink: 0;
}

/* ── Panel derecho ───────────────────────────────────────────────────────── */
.auth-panel-right {
  background: var(--white);
  padding: 2.5rem 2.5rem 2rem;
  display: flex;
  flex-direction: column;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  gap: .25rem;
  background: var(--bg);
  border-radius: 10px;
  padding: .25rem;
  margin-bottom: 1.75rem;
}

.tab-btn {
  flex: 1;
  padding: .55rem .5rem;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn.active {
  background: var(--white);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
}

/* ── Formulario ──────────────────────────────────────────────────────────── */
.auth-form h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .3rem;
}

.form-subtitle {
  font-size: .88rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.hidden { display: none !important; }

.input-group {
  margin-bottom: 1rem;
}

.input-group label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .4rem;
}

.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrap > i:first-child {
  position: absolute;
  left: .9rem;
  color: var(--text-muted);
  font-size: .85rem;
  pointer-events: none;
}

.input-icon-wrap input {
  width: 100%;
  padding: .65rem .9rem .65rem 2.4rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .92rem;
  color: var(--text);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}

.input-icon-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.toggle-pass {
  position: absolute;
  right: .8rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: .2rem;
  font-size: .85rem;
  line-height: 1;
}

/* Medidor de fortaleza de contraseña */
.password-strength {
  height: 4px;
  border-radius: 4px;
  margin-top: .4rem;
  background: var(--border);
  overflow: hidden;
  transition: var(--transition);
}

.password-strength::after {
  content: '';
  display: block;
  height: 100%;
  border-radius: 4px;
  transition: width .3s ease, background .3s ease;
}

.password-strength[data-level="1"]::after { width: 25%; background: var(--error); }
.password-strength[data-level="2"]::after { width: 50%; background: var(--warning); }
.password-strength[data-level="3"]::after { width: 75%; background: #84cc16; }
.password-strength[data-level="4"]::after { width: 100%; background: var(--success); }

/* ── Alertas ─────────────────────────────────────────────────────────────── */
.alert {
  padding: .7rem 1rem;
  border-radius: 8px;
  font-size: .85rem;
  margin-bottom: .75rem;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  line-height: 1.4;
}

.alert-error   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* ── Botón principal ─────────────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: .75rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-top: .5rem;
}

.btn-primary:hover  { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,.35); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .65; cursor: not-allowed; transform: none; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .auth-wrapper {
    grid-template-columns: 1fr;
    max-width: 440px;
    min-height: auto;
  }

  .auth-panel-left {
    padding: 2rem 1.75rem;
  }

  .auth-panel-left h1 { font-size: 1.5rem; }

  .features { display: none; }

  .auth-panel-right {
    padding: 1.75rem 1.5rem 1.5rem;
  }
}
