/* ==========================================================================
   MACRO REBORN — ACCESO (Login / Registro)
   Se apoya en las variables y clases ya definidas en inicio.css
   (paleta slate oscuro + dorado, fuente Orbitron/Inter, botones .boton,
   panel "cartucho" .mr-notched, orbes decorativos) para que iniciar
   sesión / registrarse se sienta como la puerta de entrada al resto
   del sitio, no como un formulario aparte.
   ========================================================================== */

.auth-page {
  min-height: 100vh;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

/* ==========================================================================
   PANEL IZQUIERDO — IDENTIDAD DE MACROREBORN
   ========================================================================== */

.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 48px;
  background:
    radial-gradient(ellipse 700px 500px at 20% -10%, rgba(240, 180, 41, 0.16), transparent 60%),
    radial-gradient(ellipse 600px 500px at 90% 110%, rgba(56, 189, 248, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-base) 60%, var(--bg-base) 100%);
  border-right: 2px solid var(--gold);
}

.auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(240, 180, 41, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240, 180, 41, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 70% 60% at 30% 30%, black 30%, transparent 85%);
  pointer-events: none;
}

.auth-brand .orbe {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
  pointer-events: none;
  animation: flotar 12s ease-in-out infinite;
}

.auth-brand .orbe-1 {
  width: 280px;
  height: 280px;
  background: var(--gold);
  top: -70px;
  left: -70px;
}

.auth-brand .orbe-2 {
  width: 240px;
  height: 240px;
  background: var(--cyan);
  bottom: -80px;
  right: -40px;
  animation-delay: -5s;
}

.auth-volver {
  position: relative;
  z-index: 2;
  align-self: flex-start;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-muted);
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.auth-volver:hover {
  color: var(--gold-bright);
  border-color: var(--gold);
  transform: translateX(-3px);
}

.auth-brand-main {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 460px;
  margin: auto 0;
}

.auth-brand-main .logo-wrapper {
  width: 84px;
  height: 84px;
  margin-bottom: 20px;
  animation: subir 4.5s ease-in-out infinite;
}

.auth-brand-main .eyebrow {
  margin-bottom: 18px;
}

.auth-brand-nombre {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 900;
  letter-spacing: 1px;
  margin: 0 0 10px;
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 55%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-brand-frase {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 30px;
}

.auth-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.auth-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14.5px;
  color: var(--text-main);
  background: var(--chip-bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  padding: 12px 16px;
  border-radius: 10px;
}

.auth-features .icono {
  font-size: 18px;
  filter: drop-shadow(0 0 6px rgba(240, 180, 41, 0.35));
}

.auth-brand .estado-servidor {
  position: relative;
  z-index: 2;
  margin-top: 30px;
}

/* ==========================================================================
   PANEL DERECHO — FORMULARIO
   ========================================================================== */

.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--bg-base);
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--bg-panel);
  border: 3px solid var(--clasico-borde);
  border-radius: var(--clasico-radio);
  padding: 40px 36px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  animation: auth-aparecer 0.5s ease both;
}

@keyframes auth-aparecer {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-card h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.5px;
  margin: 0 0 6px;
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 55%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-card > p {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 28px;
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.campo {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.campo label {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.campo input {
  width: 100%;
  padding: 13px 15px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.campo input::placeholder {
  color: var(--text-placeholder);
}

.campo input:hover {
  border-color: var(--line-hover);
}

.campo input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.campo input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Mensaje de error / éxito del formulario (oculto por defecto) */
.auth-mensaje {
  display: none;
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  line-height: 1.4;
}

.auth-mensaje.visible {
  display: block;
  animation: auth-mensaje-in 0.2s ease both;
}

.auth-mensaje.error {
  color: var(--danger-light);
  background: var(--danger-bg);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
}

.auth-mensaje.exito {
  color: var(--success-light);
  background: var(--success-bg);
  border-color: color-mix(in srgb, var(--success) 35%, transparent);
}

@keyframes auth-mensaje-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-card.auth-shake {
  animation: auth-shake 0.4s ease;
}

@keyframes auth-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}

.auth-card button[type="submit"] {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 15px;
  padding: 14px 26px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  margin-top: 4px;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold) 60%, var(--gold-deep));
  color: var(--text-on-accent);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 28%, transparent);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.auth-card button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 40%, transparent);
}

.auth-card button[type="submit"]:active {
  transform: translateY(0);
}

.auth-card button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-card .registro {
  margin-top: 24px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-muted);
}

.auth-card .registro a {
  color: var(--gold-bright);
  font-weight: 700;
  transition: color 0.15s ease;
}

.auth-card .registro a:hover {
  color: var(--gold);
  text-decoration: underline;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    border-right: none;
    border-bottom: 2px solid var(--gold);
    padding: 28px 28px 40px;
  }

  .auth-brand-main {
    margin: 0;
  }

  .auth-brand-main .logo-wrapper {
    width: 64px;
    height: 64px;
    margin-bottom: 14px;
  }

  .auth-brand-frase {
    font-size: 14.5px;
    margin-bottom: 20px;
  }

  .auth-features {
    display: none;
  }

  .auth-brand .estado-servidor {
    display: none;
  }
}

@media (max-width: 520px) {
  .auth-form-panel {
    padding: 28px 16px 44px;
  }

  .auth-card {
    padding: 30px 22px;
  }

  .auth-volver {
    font-size: 12.5px;
  }
}

/* En mobile, cualquier input con font-size menor a 16px hace que Safari
   (iOS) haga zoom automático al tocarlo. Se sube a 16px solo en pantallas
   chicas para no cambiar el diseño de escritorio. */
@media (max-width: 768px) {
  .campo input {
    font-size: 16px;
  }
}
