/* =====================================================
   BUZZCHAT – AUTH CSS (LOGIN / REGISTER)
   Limpio • Estable • Sin bugs de blur
===================================================== */

/* =========================
   RESET
========================= */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* =========================
   ROOT
========================= */
:root {
  --bg-main: #0f1117;
  --bg-card: #1e2535;
  --bg-card-2: #161b27;

  --border-soft: rgba(255, 255, 255, 0.08);
  --border-focus: #a0a8b4;

  --text-main: #f0f4f8;
  --text-muted: #6b7e96;

  --primary: #a0a8b4;
  --primary-hover: #c8cdd4;
  --danger: #ef4444;
  --success: #a0a8b4;

  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 8px;
}

/* =========================
   PAGE
========================= */
body.auth-page {
  min-height: 100vh;
  font-family: "DM Sans", "Inter", system-ui, sans-serif;
  background: #0f1117;
  color: #ffffff;

  display: flex;
  justify-content: center;

  /* ✅ CLAVE */
  align-items: flex-start;
  overflow-y: auto;
}

/* =========================
   BACKGROUND DECORATION
========================= */
.auth-background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.circle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.08),
    transparent 70%
  );
  animation: float 18s ease-in-out infinite;
}

.circle-1 {
  width: 260px;
  height: 260px;
  top: -80px;
  left: -80px;
}

.circle-2 {
  width: 360px;
  height: 360px;
  bottom: -120px;
  right: -120px;
  animation-delay: 5s;
}

.circle-3 {
  width: 220px;
  height: 220px;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 10s;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.25;
  }
  50% {
    transform: translate(20px, 20px) scale(1.1);
    opacity: 0.45;
  }
}

/* =========================
   CONTAINER
========================= */
.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  padding: 20px;
}

/* =========================
   CARD
========================= */
.auth-box {
  background: linear-gradient(
    180deg,
    var(--bg-card),
    var(--bg-card-2)
  );
  border-radius: var(--radius-lg);
  padding: 40px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);

  /* 🔥 CLAVE para evitar bugs gráficos */
  isolation: isolate;
}

/* =========================
   LOGO
========================= */
.auth-logo {
  text-align: center;
}

.auth-logo img {
  width: 93px;
  height: 93px;
  object-fit: contain;
  margin-bottom: 10px;
}

.auth-logo h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
}

/* =========================
   TITLES
========================= */
.auth-box h2 {
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
}

.auth-subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 26px;
}

/* =========================
   FORM
========================= */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #e5e7eb;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 14px;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.form-group input::placeholder {
  color: #6b7280;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(160, 168, 180, 0.18);
}

.form-group small {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* =========================
   BUTTON
========================= */
.btn-primary {
  margin-top: 10px;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(
    135deg,
    #3a3f4a,
    #2a2d35
  );
  color: #f0f4f8;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(255, 255, 255, 0.15);
}

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

/* =========================
   FOOTER
========================= */
.auth-footer {
  margin-top: 22px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

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

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

/* =========================
   SELECT OPTIONS
========================= */
select option {
  background: #111;
  color: #fff;
}

/* =========================
   AUTOFILL FIX
========================= */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.04) inset;
}

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

  .auth-logo img {
    width: 60px;
    height: 60px;
  }

  .auth-logo h1 {
    font-size: 22px;
  }
}


/* =========================
   🔒 AUTOFILL FIX DEFINITIVO
========================= */

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
select:-webkit-autofill {
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #ffffff;

  /* Truco clave */
  transition: background-color 9999s ease-in-out 0s;

  /* Forzamos fondo oscuro */
  -webkit-box-shadow:
    0 0 0px 1000px rgba(255, 255, 255, 0.04) inset !important;

  box-shadow:
    0 0 0px 1000px rgba(255, 255, 255, 0.04) inset !important;

  border: 1px solid var(--border-soft);
}

.auth-error {
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fecaca;
  font-size: 14px;
  text-align: center;
}

.password-wrapper {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-muted);
}

.toggle-password:hover {
  color: var(--text-main);
}

.btn-primary.loading {
  opacity: 0.7;
  cursor: not-allowed;
}