/* ============================================================
   Estilo replicado del login de SMOG — Cooperación Seguros
   (glassmorphism oscuro, acento cyan #5bc0de)
   ============================================================ */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Roboto, "Helvetica Neue", -apple-system, "Segoe UI", sans-serif;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(180deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

/* Contenedor con fondo */
.login-container {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url('assets/images/FondoLogin.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  overflow: hidden;
}

.login-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(26, 35, 50, 0.7) 0%, rgba(20, 28, 40, 0.8) 100%);
  pointer-events: none;
}

/* Patrón de fondo animado */
.background-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.4;
  background-image:
    repeating-linear-gradient(90deg, transparent, transparent 100px, rgba(0, 0, 0, 0.03) 100px, rgba(0, 0, 0, 0.03) 101px),
    repeating-linear-gradient(0deg, transparent, transparent 100px, rgba(0, 0, 0, 0.03) 100px, rgba(0, 0, 0, 0.03) 101px);
}

.background-pattern::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(circle at 30% 50%, rgba(0, 0, 0, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 70% 30%, rgba(23, 37, 59, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(0, 0, 0, 0.03) 0%, transparent 50%);
  animation: float 30s ease-in-out infinite;
}

/* Contenido */
.login-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 450px;
  padding: 20px;
}

/* Logo */
.logo-section {
  text-align: center;
  margin-bottom: 30px;
}

.login-logo {
  max-width: 300px;
  width: 100%;
  height: auto;
  background: #ffffff;
  padding: 16px 22px;
  border-radius: 12px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

/* Tarjeta */
.login-card {
  background: linear-gradient(135deg, rgba(20, 28, 40, 0.9) 0%, rgba(26, 35, 50, 0.9) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(91, 192, 222, 0.2);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(91, 192, 222, 0.05),
    inset 0 0 0 1px rgba(91, 192, 222, 0.1);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}

.login-card .card-content {
  padding: 32px;
  position: relative;
  z-index: 1;
}

.card-title {
  margin: 0 0 24px;
  text-align: center;
  color: #ffffff;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Campos */
.full-width { width: 100%; margin-bottom: 16px; }

.field {
  position: relative;
  display: flex;
  align-items: center;
  background-color: rgba(10, 14, 39, 0.5);
  border: 1px solid rgba(91, 192, 222, 0.25);
  border-radius: 12px;
  padding: 0 12px;
  transition: all 0.3s ease;
}

.field:hover {
  background-color: rgba(10, 14, 39, 0.7);
  border-color: rgba(91, 192, 222, 0.45);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.field:focus-within {
  border-color: #5bc0de;
  box-shadow: 0 0 0 4px rgba(91, 192, 222, 0.1), 0 4px 20px rgba(91, 192, 222, 0.2);
}

.field .material-icons.prefix {
  color: #5bc0de;
  opacity: 0.7;
  margin-right: 12px;
  transition: opacity 0.3s ease;
}

.field:focus-within .material-icons.prefix { opacity: 1; }

.field label {
  position: absolute;
  left: 48px;
  top: -9px;
  font-size: 12px;
  padding: 0 6px;
  color: rgba(255, 255, 255, 0.7);
  background: #161f2e;
  border-radius: 4px;
  transition: color 0.3s ease;
}

.field:focus-within label { color: #5bc0de; }

.field input,
.field select {
  flex: 1;
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 15px;
  padding: 15px 0;
  caret-color: #5bc0de;
}

.field input::placeholder { color: rgba(255, 255, 255, 0.5); }

.field select { cursor: pointer; }
.field select option { background-color: #1a1f3a; color: #ffffff; }

.field .toggle-pass {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}
.field .toggle-pass:hover { color: #5bc0de; }

/* Mensaje de estado / error */
.status-msg {
  display: none;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 16px;
}
.status-msg.info { background: rgba(91, 192, 222, 0.1); color: #9fdcef; border: 1px solid rgba(91, 192, 222, 0.25); }
.status-msg.error { background: rgba(255, 107, 107, 0.12); color: #ff6b6b; border: 1px solid rgba(255, 107, 107, 0.3); }

/* Botón INGRESAR */
.login-button {
  width: 100%;
  height: 48px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 2px;
  margin-top: 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #5bc0de 0%, #357a9a 100%);
  border: none;
  color: #ffffff;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  text-transform: uppercase;
}

.login-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.login-button:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(91, 192, 222, 0.4), 0 0 40px rgba(91, 192, 222, 0.2);
}
.login-button:not(:disabled):hover::before { left: 100%; }
.login-button:not(:disabled):active { transform: translateY(0); }
.login-button:disabled {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.5) 0%, rgba(23, 37, 59, 0.5) 100%);
  cursor: not-allowed;
}

/* Link olvidó contraseña */
.forgot-password { text-align: center; margin-top: 16px; }
.forgot-password a {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.3s ease;
}
.forgot-password a:hover { color: #ffffff; text-decoration: underline; }

/* Footer seguridad */
.security-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
}
.security-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(91, 192, 222, 0.1);
  border: 1px solid rgba(91, 192, 222, 0.2);
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.security-badge .material-icons { font-size: 16px; color: #5bc0de; }
.version-info { color: rgba(255, 255, 255, 0.4); font-size: 11px; letter-spacing: 0.5px; }

/* Spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Dashboard de bienvenida (Página B tras login) */
.dashboard { text-align: center; padding: 8px 0; }
.dashboard .check {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(91, 192, 222, 0.15);
  border: 1px solid rgba(91, 192, 222, 0.4);
  color: #5bc0de;
  font-size: 34px;
  line-height: 64px;
}
.dashboard h2 { margin: 0 0 6px; color: #ffffff; font-weight: 500; }
.dashboard p { color: rgba(255, 255, 255, 0.6); font-size: 14px; margin: 0; }

/* Responsive */
@media (max-width: 600px) {
  .login-content { padding: 16px; max-width: 100%; }
  .login-logo { max-width: 280px; }
  .login-card .card-content { padding: 20px 16px; }
}
