/*
  Estilos para páginas de autenticación (login/registro/olvido/reset)
  - Diseño tipo “glass card” con fondo animado
  - Inputs con iconos y botón para mostrar/ocultar contraseña
  - Estados visuales de validación (is-valid / is-invalid)
*/

:root {
  --auth-bg-start: #0b1020;
  --auth-bg-end: #0f1a33;
  --auth-card-bg: rgba(14, 18, 28, 0.72);
  --auth-card-border: rgba(255,255,255,0.08);
  --auth-field-bg: rgba(255,255,255,0.04);
  --auth-field-border: rgba(255,255,255,0.12);
  --auth-field-focus: #4da3ff;
  --auth-text: #e6eaf2;
  --auth-muted: #9aa4b2;
}

body.auth-page {
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 10% -10%, #1a2a6c 0%, transparent 60%),
              radial-gradient(1200px 600px at 110% 110%, #b21f1f 0%, transparent 60%),
              linear-gradient(160deg, var(--auth-bg-start), var(--auth-bg-end));
  color: var(--auth-text);
  background-size: 200% 200%, 200% 200%, 100% 100%;
  animation: bg-pan 18s ease-in-out infinite;
  position: relative;
}

/* Animated soft blobs */
body.auth-page::before,
body.auth-page::after {
  content: '';
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.25;
  z-index: 0;
}
body.auth-page::before { background: #4da3ff; top: 8%; left: -6%; animation: float1 22s ease-in-out infinite; }
body.auth-page::after  { background: #ff6b6b; bottom: -8%; right: -6%; animation: float2 26s ease-in-out infinite; }

@keyframes bg-pan {
  0%, 100% { background-position: 0% 0%, 100% 100%, 0% 0%; }
  50%      { background-position: 100% 100%, 0% 0%, 0% 0%; }
}
@keyframes float1 { 0%,100%{ transform: translate(0,0);} 50%{ transform: translate(24px, -18px);} }
@keyframes float2 { 0%,100%{ transform: translate(0,0);} 50%{ transform: translate(-28px, 22px);} }

.auth-card { position: relative; z-index: 1; }

/* Burbujas ascendiendo (fondo decorativo) */
.auth-bubbles{ position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.auth-bubbles .bubble{
  position: absolute;
  bottom: -100px;
  width: 14px; height: 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  box-shadow: inset 0 0 10px rgba(255,255,255,0.15);
  animation: bubbleUp linear infinite;
}

@keyframes bubbleUp {
  0%   { transform: translateY(0) translateX(0) scale(1); opacity: .0; }
  10%  { opacity: .5; }
  100% { transform: translateY(-110vh) translateX(-20px) scale(1.15); opacity: 0; }
}

/* Variaciones por burbuja (posición, tamaño, velocidad, retardo) */
.auth-bubbles .bubble:nth-child(1)  { left: 5%;  width:12px; height:12px; animation-duration: 12s; animation-delay: 0s; }
.auth-bubbles .bubble:nth-child(2)  { left: 12%; width:10px; height:10px; animation-duration: 10s; animation-delay: 1s; }
.auth-bubbles .bubble:nth-child(3)  { left: 20%; width:16px; height:16px; animation-duration: 14s; animation-delay: .5s; }
.auth-bubbles .bubble:nth-child(4)  { left: 28%; width:8px;  height:8px;  animation-duration: 9s;  animation-delay: 2s; }
.auth-bubbles .bubble:nth-child(5)  { left: 36%; width:14px; height:14px; animation-duration: 13s; animation-delay: 1.3s; }
.auth-bubbles .bubble:nth-child(6)  { left: 44%; width:18px; height:18px; animation-duration: 16s; animation-delay: .8s; }
.auth-bubbles .bubble:nth-child(7)  { left: 52%; width:9px;  height:9px;  animation-duration: 11s; animation-delay: 2.2s; }
.auth-bubbles .bubble:nth-child(8)  { left: 60%; width:13px; height:13px; animation-duration: 12.5s;animation-delay: .2s; }
.auth-bubbles .bubble:nth-child(9)  { left: 68%; width:11px; height:11px; animation-duration: 10.5s;animation-delay: 1.8s; }
.auth-bubbles .bubble:nth-child(10) { left: 76%; width:17px; height:17px; animation-duration: 15s; animation-delay: .9s; }
.auth-bubbles .bubble:nth-child(11) { left: 84%; width:12px; height:12px; animation-duration: 11.5s;animation-delay: 1.1s; }
.auth-bubbles .bubble:nth-child(12) { left: 92%; width:9px;  height:9px;  animation-duration: 9.5s; animation-delay: 2.5s; }

.auth-shell {
  min-height: calc(100vh - 80px);
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--auth-card-bg);
  border: 1px solid var(--auth-card-border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(10px);
}

.auth-card h2 {
  margin: 0 0 8px 0;
  font-size: 1.6rem;
  text-align: center;
}

.auth-subtitle {
  text-align: center;
  color: var(--auth-muted);
  margin-bottom: 18px;
}

.auth-fields {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.input-with-icon { position: relative; }
.input-with-icon .field-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--auth-muted);
  pointer-events: none;
}
.input-with-icon .toggle-pass {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--auth-muted);
  cursor: pointer;
  padding: 4px 6px;
}

.auth-field label {
  display: block;
  font-size: 0.9rem;
  color: var(--auth-muted);
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--auth-field-border);
  background: var(--auth-field-bg);
  color: var(--auth-text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.input-with-icon .auth-input { padding-left: 38px; padding-right: 38px; }

.auth-input:focus {
  border-color: var(--auth-field-focus);
  box-shadow: 0 0 0 3px rgba(77,163,255,0.25);
}

.auth-input.is-valid { border-color: rgba(47,208,114,0.65); }
.auth-input.is-invalid { border-color: rgba(255,107,107,0.75); }

.auth-submit {
  width: 100%;
  margin-top: 6px;
}

.auth-links {
  text-align: center;
  margin-top: 12px;
}

.auth-links a { color: #7ec3ff; text-decoration: underline; }

.access-status {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--auth-card-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.access-status.ok { color: #2fd072; border-color: rgba(47,208,114,0.35); background: rgba(47,208,114,0.08); }
.access-status.error { color: #ff6b6b; border-color: rgba(255,107,107,0.35); background: rgba(255,107,107,0.08); }

/* Tweak header spacing for auth pages */
body.auth-page .header { position: sticky; top: 0; }
