body:not(.auth-ready) .app,
body:not(.auth-ready) #menu-btn,
body:not(.auth-ready) > .overlay {
  visibility: hidden;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 18px;
  background:
    radial-gradient(ellipse at 18% 16%, #f7dce2 0, transparent 33%),
    radial-gradient(ellipse at 86% 82%, #f2e7d8 0, transparent 32%),
    #fffaf7;
}

.auth-screen[hidden] { display: none !important; }
.auth-card {
  display: grid;
  width: min(420px, 100%);
  gap: 11px;
  border: 1px solid #f0dfe2;
  border-radius: 24px;
  padding: 27px;
  background: #fffdfb;
  color: #594b55;
  box-shadow: 0 20px 70px #84536321;
}
.auth-bears { margin: 0 0 3px; text-align: center; font-size: 41px; }
.auth-card h1 { margin: 0; font-family: Georgia, serif; font-size: 25px; text-align: center; }
.auth-card > p { margin: 0 0 7px; color: #968691; font-size: 12px; line-height: 1.55; text-align: center; }
.auth-card label { margin-top: 3px; color: #7e6c78; font-size: 11px; font-weight: 900; }
.auth-card select, .auth-card input {
  width: 100%;
  min-height: 43px;
  border: 1px solid #eadfe2;
  border-radius: 11px;
  padding: 10px 12px;
  background: white;
  color: #594b55;
  font: inherit;
}
.auth-card small { color: #a18f99; font-size: 10px; text-align: center; }
.auth-message { min-height: 18px; color: #a35667; font-size: 11px; line-height: 1.45; }
.auth-message:empty { min-height: 0; }
.auth-logout {
  flex: 0 0 auto;
  border: 1px solid #eadfe2;
  border-radius: 9px;
  padding: 6px 9px;
  background: white;
  color: #8d6a77;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.auth-logout:hover { border-color: #dca4ad; color: #9c5e70; }

@media (max-width: 500px) {
  .auth-card { padding: 22px 18px; }
  .auth-logout { padding: 6px; font-size: 10px; }
}

/* ─────────────────────────────────────────────────────────────
   MODAL DE RESTABLECER CONTRASEÑA
   Sigue el estilo de los modales TCG de la web
   ───────────────────────────────────────────────────────────── */

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 18px;
  background:
    radial-gradient(ellipse at 18% 16%, #f7dce2 0, transparent 33%),
    radial-gradient(ellipse at 86% 82%, #f2e7d8 0, transparent 32%),
    #fffaf7;
}

/* Enlace discreto para "¿olvidé mi contraseña?" */
.auth-forgot-link {
  justify-self: center;
  margin: -2px 0 2px;
  border: 0;
  padding: 2px 4px;
  background: none;
  color: #a35667;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #e3c3ca;
  cursor: pointer;
  transition: color .15s ease, text-decoration-color .15s ease;
}
.auth-forgot-link:hover { color: #8d4457; text-decoration-color: #d99aa7; }

/* Overlay del modal */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 12100;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 18px;
  background: #342333bf;
  backdrop-filter: blur(5px);
  animation: authModalFade .18s ease;
}
.auth-modal-overlay[hidden] { display: none !important; }
@keyframes authModalFade { from { opacity: 0; } to { opacity: 1; } }

/* Tarjeta del modal */
.auth-modal {
  width: min(420px, 100%);
  max-height: min(92vh, 720px);
  overflow: auto;
  border: 1px solid #f1dfe2;
  border-radius: 22px;
  padding: 24px;
  background: #fffdfb;
  color: #594b55;
  box-shadow: 0 24px 80px #1c102a55;
  animation: authModalPop .2s cubic-bezier(.32, 1.2, .4, 1);
}
@keyframes authModalPop {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.auth-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.auth-modal-title { margin: 4px 0 0; font-family: Georgia, serif; font-size: 22px; color: #594b55; }
.auth-modal-close {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #eadfe2;
  border-radius: 9px;
  background: #fff4f4;
  color: #956373;
  font: inherit;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.auth-modal-close:hover { border-color: #dca4ad; background: #ffe9ec; }

.auth-modal-fields { display: grid; gap: 11px; }
.auth-modal-fields label {
  margin-top: 3px;
  color: #7e6c78;
  font-size: 11px;
  font-weight: 900;
}
.auth-modal-fields select,
.auth-modal-fields input {
  width: 100%;
  min-height: 43px;
  border: 1px solid #eadfe2;
  border-radius: 11px;
  padding: 10px 12px;
  background: white;
  color: #594b55;
  font: inherit;
}
.auth-modal-fields input:focus,
.auth-modal-fields select:focus {
  outline: none;
  border-color: #d99aa7;
  box-shadow: 0 0 0 3px #f7dce266;
}

.auth-modal-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid #f0dfe2;
  border-radius: 11px;
  background: #fff8f7;
  color: #a18f99;
  font-size: 10.5px;
  line-height: 1.5;
}

.auth-modal-actions { display: grid; gap: 9px; margin-top: 16px; }

/* ─────────────────────────────────────────────────────────────
   AJUSTES — PANEL DE CONTRASEÑA
   ───────────────────────────────────────────────────────────── */

.pw-card-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--bubu-soft);
  font-size: 18px;
}

.pw-fields { display: grid; gap: 11px; }
.pw-fields label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .2px;
}
.pw-fields input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.pw-fields input:focus {
  outline: none;
  border-color: var(--bubu);
  box-shadow: 0 0 0 3px rgba(214, 138, 160, .16);
}
.pw-hint { color: var(--muted); font-size: 10.5px; line-height: 1.5; margin-top: 2px; }
.pw-hint.is-error { color: #b4516a; }
.pw-hint.is-ok { color: #4c8a5f; }

.pw-submit {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, #d98ca8, #c9738f);
  color: #fff;
  font: inherit;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease, opacity .15s ease;
  box-shadow: 0 4px 12px rgba(201, 115, 143, .28);
}
.pw-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(201, 115, 143, .34); }
.pw-submit:active:not(:disabled) { transform: scale(.98); }
.pw-submit:disabled { opacity: .6; cursor: not-allowed; }

@media (max-width: 500px) {
  .auth-modal { padding: 20px 17px; border-radius: 18px; }
  .auth-modal-title { font-size: 19px; }
}
