/* =========================================================
   AUTH.CSS — Páginas de autenticación
   Requiere que app.css ya haya definido las variables CSS.
   ========================================================= */

/* Centra el contenido verticalmente */
body.auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--background);
  padding: 24px 16px;
}

/* Wrapper externo que limita el ancho */
.auth-container {
  width: 100%;
  max-width: 460px;
}

/* Logo / branding arriba de la tarjeta */
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.auth-brand-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-brand-icon svg { color: #fff; }

.auth-brand-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}

/* Tarjeta principal */
.auth-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 36px 40px 32px;
  border: 1px solid var(--border);
}

.auth-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
  margin-bottom: 6px;
}

.auth-card-subtitle {
  font-size: .88rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

/* Alerta / banner de error o éxito dentro de la card */
.auth-alert {
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: .85rem;
  line-height: 1.5;
  margin-bottom: 22px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.auth-alert svg { flex-shrink: 0; margin-top: 1px; }

.auth-alert.success {
  background: var(--success-light);
  color: var(--success-text);
  border: 1px solid #bbf7d0;
}

.auth-alert.error {
  background: var(--danger-light);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.auth-alert.warning {
  background: var(--warning-light);
  color: var(--warning-text);
  border: 1px solid #fde68a;
}

.auth-alert.info {
  background: var(--primary-light);
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.auth-alert-body { flex: 1; }

.auth-alert ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.auth-alert li { margin-bottom: 2px; }

/* Grupos de campo */
.auth-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.auth-form .form-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
}

.auth-form .form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.auth-form .form-input {
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
  color: var(--text);
  font-size: .9rem;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}

.auth-form .form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(147,197,253,.25);
  background: var(--surface);
}

.auth-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Botón principal */
.btn-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: .92rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 10px rgba(37,99,235,.28);
  margin-top: 8px;
}

.btn-auth:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(37,99,235,.36);
}

.btn-auth:active { transform: translateY(0); }

.btn-auth:disabled {
  opacity: .65;
  cursor: not-allowed;
  transform: none;
}

/* Link de pie de tarjeta */
.auth-footer {
  text-align: center;
  margin-top: 22px;
  font-size: .85rem;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-footer a:hover { text-decoration: underline; }

.auth-footer span.disabled-link {
  color: var(--muted);
  font-weight: 500;
  cursor: not-allowed;
}

/* Hint de campo */
.field-hint {
  font-size: .75rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Divisor */
.auth-divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* Estado vacío / de éxito centrado */
.auth-result {
  text-align: center;
  padding: 10px 0;
}

.auth-result-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.auth-result-icon.success { background: var(--success-light); }
.auth-result-icon.success svg { color: var(--success-text); }

.auth-result-icon.error { background: var(--danger-light); }
.auth-result-icon.error svg { color: var(--danger); }

.auth-result-icon.warning { background: var(--warning-light); }
.auth-result-icon.warning svg { color: var(--warning-text); }

.auth-result h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -.01em;
}

.auth-result p {
  color: var(--text-secondary);
  font-size: .9rem;
  line-height: 1.6;
  max-width: 340px;
  margin: 0 auto 22px;
}

.btn-auth-outline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: .88rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition);
}

.btn-auth-outline:hover {
  background: var(--background);
  border-color: var(--primary);
  color: var(--primary);
}

/* Password strength hint */
.password-strength {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin-top: 6px;
  overflow: hidden;
}

.password-strength-bar {
  height: 100%;
  border-radius: 2px;
  width: 0%;
  transition: width .25s ease, background .25s ease;
}

.password-strength-bar.weak   { background: var(--danger);  width: 33%; }
.password-strength-bar.medium { background: var(--warning); width: 66%; }
.password-strength-bar.strong { background: var(--success); width: 100%; }

.password-strength-label {
  font-size: .72rem;
  margin-top: 4px;
  color: var(--muted);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 520px) {
  .auth-card {
    padding: 28px 22px 24px;
  }

  .auth-form .form-row {
    grid-template-columns: 1fr;
  }
}
