/**
 * ======================================================
 * ARCHIVO: auth-modal.css
 * UBICACIÓN: frontend/public/styles/
 * VERSIÓN: 1.0
 * ÚLTIMA ACTUALIZACIÓN: 2026-03-05
 *
 * Estilos futuristas para modales de autenticación.
 * - Login: imagen promo bonos (izq) + formulario (der)
 * - Registro: imagen (izq) + formulario 2 columnas (der)
 * - Responsive: móvil y desktop
 *
 * ======================================================
 */

/* ===============================
   MODAL BASE FUTURISTA
================================ */
.auth-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 18, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.auth-modal.active {
  display: flex;
}

.auth-modal-box,
.auth-modal .login-box {
  background: linear-gradient(165deg, #1a1d26 0%, #252830 100%) !important;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  padding: 0 !important;
}

/* Imagen promo (izquierda) */
.auth-modal-image {
  flex: 0 0 260px;
  min-height: 360px;
  background: linear-gradient(135deg, rgba(74, 144, 217, 0.15) 0%, rgba(163, 107, 255, 0.1) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  position: relative;
}

.auth-modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.auth-modal-image-placeholder {
  text-align: center;
  color: rgba(255,255,255,0.7);
}

.auth-modal-image-placeholder .icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.8;
}

.auth-modal-image-placeholder p {
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Formulario (derecha) */
.auth-modal-form {
  flex: 1;
  padding: 32px 36px;
  overflow-y: auto;
  min-width: 0;
}

.auth-modal-form h2 {
  color: #fff;
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

.auth-modal-form label {
  display: block;
  color: rgba(255,255,255,0.85);
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.auth-modal-form input,
.auth-modal-form select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 0.9rem;
  transition: border-color 0.2s, background 0.2s;
}

.auth-modal-form input::placeholder {
  color: rgba(255,255,255,0.35);
}

.auth-modal-form input:focus,
.auth-modal-form select:focus {
  outline: none;
  border-color: #4a90d9;
  background: rgba(255,255,255,0.08);
}

.auth-modal-form select option {
  background: #1a1d26;
  color: #fff;
}

/* Grid 2 columnas para registro */
.auth-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}

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

.auth-modal-form .form-group {
  margin-bottom: 14px;
}

/* Password wrapper */
.password-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.password-wrapper input {
  flex: 1;
}

.toggle-password {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.8);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}

/* Botones */
.auth-modal .login-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.auth-modal .btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.auth-modal .btn-primary {
  background: linear-gradient(135deg, #4a90d9 0%, #3a7bc8 100%);
  color: #fff;
  flex: 1;
}

.auth-modal .btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.auth-modal .btn-secondary {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.2);
}

.auth-modal .btn-secondary:hover {
  background: rgba(255,255,255,0.15);
}

.auth-modal .login-links {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-modal .link-btn {
  background: none;
  border: none;
  font-size: 0.85rem;
  color: #6eb5ff;
  cursor: pointer;
  padding: 0;
}

.auth-modal .link-btn:hover {
  text-decoration: underline;
}

.auth-modal .login-error {
  color: #f87171;
  font-size: 0.85rem;
  margin-top: 8px;
}

/* Checkbox política */
.auth-modal .checkbox {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  margin: 16px 0;
}

.auth-modal .checkbox input {
  width: auto;
  margin-top: 4px;
}

.auth-modal .checkbox label {
  flex: 1;
  min-width: 0;
  font-size: 0.8rem;
  margin-bottom: 0;
}

.auth-modal .checkbox .link-btn {
  flex: 0 0 100%;
}

/* ===============================
   BOTONES HEADER COMPACTOS
================================ */
.btn-auth-compact {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-search-compact {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
}

.btn-search-compact:hover {
  background: rgba(255,255,255,0.18);
}

.btn-login-compact {
  background: linear-gradient(135deg, #4a90d9 0%, #3a7bc8 100%);
  color: #fff;
}

.btn-login-compact:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74, 144, 217, 0.4);
}

/* ===============================
   RESPONSIVE
================================ */
@media (max-width: 640px) {
  .auth-modal-box {
    flex-direction: column;
    max-height: 95vh;
  }

  .auth-modal-image {
    flex: 0 0 auto;
    min-height: 140px;
    padding: 20px;
  }

  .auth-modal-image-placeholder .icon {
    font-size: 40px;
  }

  .auth-modal-image-placeholder p {
    font-size: 0.85rem;
  }

  .auth-modal-form {
    padding: 24px 20px;
  }

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

  .auth-modal .login-actions {
    flex-direction: column;
  }

  .auth-modal .btn {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .btn-auth-compact {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
}
