/* =========================================================
   Login (login.html) — DEFINITIVO UNIFICADO (Runway Style)
   ========================================================= */
:root {
  --sp-bg: #09090b;
  --sp-surface: #12111a;
  --sp-border: #232236;
  --sp-text: #e9e7ff;
  --sp-muted: #a1a1aa;
  --sp-accent: #7c3aed;
}

.auth-body {
  background: var(--sp-bg);
  color: var(--sp-text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  margin: 0;
}

/* =========================================
   LAYOUT DESKTOP
   ========================================= */
.auth-page {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  min-height: 100dvh;
  background-color: var(--sp-bg);
}

/* --- IZQUIERDA (IMAGEN) --- */
.auth-left {
  position: relative;
  overflow: hidden;
  z-index: 10;
  box-shadow: 1px 0 0 var(--sp-bg);
}

.auth-cover {
  position: absolute;
  inset: 0;
  display: block;
}

.auth-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* DEGRADADO SUAVE */
.auth-left::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  background: linear-gradient(to right,
      transparent 0%,
      rgba(9, 9, 11, 0) 10%,
      rgba(9, 9, 11, 0.1) 25%,
      rgba(9, 9, 11, 0.4) 50%,
      rgba(9, 9, 11, 0.8) 75%,
      var(--sp-bg) 95%,
      var(--sp-bg) 100%);
}

.auth-caption {
  position: relative;
  z-index: 30;
  padding: 40px;
}

.auth-caption .brand-row {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
    width: 60px;
    height: 60px;
    padding: 0px 6px 0px 0px;
    margin-bottom: 11px;
}

.brand-txt {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.2;
}

.brand-name {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}

.brand-tag {
  margin: 0;
  opacity: 0.85;
  font-size: 0.9rem;
  color: #e4e4e7b8;
}

/* --- DERECHA (FORMULARIO) --- */
.auth-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--sp-bg);
  position: relative;
  z-index: 15;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  border-radius: 20px;
  padding: 32px;
  background: rgb(0, 0, 0);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.auth-card h2 {
  margin: 0 0 8px;
  font-size: 1.8rem;
  /* Confirmed size */
  color: #fff;
  letter-spacing: -0.01em;
  text-align: center;
  /* Center Title Desktop */
}

.muted {
  color: var(--sp-muted);
  font-size: 0.9rem;
  /* Clean readable size */
  margin-bottom: 24px;
  text-align: center;
  /* Center Subtitle Desktop */
}

/* --- FORM ELEMENTS (UNIFIED RUNWAY STYLE) --- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  /* Increased "Air" for premium feel */
}

/* INPUTS: Glassy, Rounded corners, Accessible Text */
.auth-form input {
  width: 100%;
  padding: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 30px;
  outline: none;
  font-size: 1.05rem;
  box-sizing: border-box;
}

.auth-form input::placeholder {
  color: rgba(255, 255, 255, 0.4);
  /* Softer placeholder */
}

.auth-form input:focus {
  background: rgba(124, 58, 237, 0.05);
  /* Gentle purple tint */
  border-color: var(--sp-accent);
}

/* BUTTONS: Pill Shape, Premium Shadow */
.btn-primary {
  width: 100%;
  padding: 16px;
  border-radius: 50px;
  border: none;
  background: #7c3aed;
  color: white;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 5px;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* GOOGLE BTN: Pill Shape, Transparent, Bordered */
.btn-google {
  width: 100%;
  padding: 16px;
  border-radius: 50px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffffb0;
  cursor: pointer;
  font-weight: 500;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.btn-google:hover {
  background: rgba(255, 255, 255, 0.116);
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.full-width {
  width: 100%;
  box-sizing: border-box;
}

.btn-ghost {
  width: 100%;
  padding: 16px;
  /* Matched to Google/Primary */
  border-radius: 50px;
  /* Pill consistency */
  border: none;
  background: #7c3aed;
  /* Fallback if used as primary variant */
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  /* Matched to others */
}

.btn-ghost:hover {
  transform: translateY(-1px);
  background: #7b56eb;
}

/* SEPARATOR */
.auth-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0;
  /* More breathing room */
  color: var(--sp-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.auth-sep::before,
.auth-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--sp-border);
  opacity: 0.6;
}

/* FOOTER LINKS */
.auth-links {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
  font-size: 0.95rem;
}

.auth-links a {
  color: var(--sp-muted);
  text-decoration: none;
}

.auth-links a:hover {
  color: #fff;
  text-decoration: underline;
}

.auth-error {
  color: #ff5f5f;
  font-size: 0.9rem;
  text-align: center;
  min-height: 20px;
  margin-top: 10px;
}

.auth-error:empty {
  display: none;
}

.legal-note-resend {
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--sp-muted);
  text-align: center;
  line-height: 1.5;
  opacity: 0.8;
}

.legal-note-resend a {
  color: var(--sp-muted);
  text-decoration: underline;
}

.legal-note-resend a:hover {
  color: #fff;
}

.auth-legal {
  margin-top: 40px;
  text-align: center;
}

.legal-links {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.legal-links a {
  color: var(--sp-muted);
  text-decoration: none;
  font-size: 0.85rem;
}

.legal-links a:hover {
  color: #fff;
}

.auth-legal small {
  color: #52525b;
  font-size: 0.8rem;
}

/* =========================================
   RESPONSIVE (MÓVIL)
   ========================================= */
@media (max-width: 1080px) {
  .auth-page {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .auth-left {
    display: none;
  }

  .auth-right {
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sp-bg);
    box-sizing: border-box;
  }

  /* Since mobile style is now Global, we just need layout resets */
  .auth-card {
    background: transparent;
    box-shadow: none;
    padding: 0;
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
  }

  .auth-card h2 {
    text-align: center;
    margin-bottom: 8px;
  }

  .auth-card .muted {
    text-align: center;
    margin-bottom: 30px;
  }

  /* REORDERING from previous logic, kept for mobile flow */
  #emailAuthContainer {
    display: block !important;
    order: 1;
    margin-top: 0 !important;
    margin-bottom: 24px;
  }

  .auth-sep {
    order: 2;
    margin: 20px 0;
    width: 100%;
    text-align: center;
  }

  #btnGoogle,
  #btnGoogleReg {
    order: 3;
    /* Styles inherited from global now! */
    margin-bottom: 0 !important;
  }

  .auth-links {
    order: 4;
    margin-top: 32px;
  }

  /* Exclusions */
  .auth-links #linkToRegister,
  .auth-links span:nth-child(2),
  .auth-legal,
  #btnShowEmailComp {
    display: none !important;
  }

  .auth-card[hidden] {
    display: none !important;
  }

  #registerBlock {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
  }

  #registerBlock>* {
    order: 0 !important;
  }
}

@media (max-width: 400px) {
  .brand-tag {
    display: none;
  }
}

/* =========================================
   MODAL RECUPERAR CONTRASEÑA
   ========================================= */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-modal-overlay[hidden] {
  display: none !important;
}

.auth-modal-card {
  width: 100%;
  max-width: 400px;
  background: rgba(24, 24, 27, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.auth-modal-card h3 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 1.5rem;
}

.form-actions-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.form-actions-row .btn-ghost {
  color: var(--sp-muted);
  border-color: transparent;
  background: transparent;
}

.form-actions-row .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }

  to {
    transform: scale(1);
  }
}