/* ════════════════════════════════════════════════════════════════
   cuenta.css — MathMentalis · página "Mi cuenta"
   Usa las variables de template.html (--bg, --card, --border, …)
   y las clases .mm-badge de layout.css.
════════════════════════════════════════════════════════════════ */

/* Que [hidden] gane siempre a los display de abajo */
.page-wrapper [hidden] { display: none !important; }

.acc-title {
  font-family: 'Fredoka One', 'Nunito', sans-serif;
  font-weight: 400;
  font-size: clamp(1.7rem, 4.5vw, 2.2rem);
  letter-spacing: .01em;
  margin: 6px 0 18px;
}

.acc-loading { color: var(--muted); padding: 24px 0; }

/* ── Hoja única: identidad + secciones separadas por filetes ── */
.acc-sheet {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

/* Identidad */
.acc-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  background: var(--surface);
}
.acc-avatar {
  flex: none;
  width: 76px; height: 76px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--start);
  color: #02101c;
  font-weight: 900;
  font-size: 2rem;
  line-height: 1;
  overflow: hidden;
}
.acc-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acc-id { min-width: 0; }
.acc-name { font-size: 1.3rem; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.acc-email { color: var(--muted); overflow-wrap: anywhere; }
.acc-id .mm-badge { display: inline-block; margin: 8px 0 0; font-size: .78rem; padding: 3px 11px; }
.acc-since { color: var(--muted); font-size: .9rem; margin-top: 6px; }

/* Secciones */
.acc-sec { padding: 22px 24px; border-top: 1px solid var(--border); }
.acc-sec > h2 { font-size: 1.05rem; font-weight: 800; margin-bottom: 14px; }
.acc-sec p + p,
.acc-sec p + .btn,
.acc-sec .btn + p { margin-top: 10px; }
.acc-sec p { line-height: 1.5; }
.acc-note { color: var(--muted); font-size: .92rem; }
.acc-strong { font-weight: 800; font-size: 1.05rem; }

/* Pares etiqueta / valor */
.acc-dl { display: grid; gap: 10px; margin-top: 16px; }
.acc-dl > div {
  display: grid;
  grid-template-columns: minmax(130px, 200px) 1fr;
  gap: 4px 16px;
}
.acc-dl--flush { margin-top: 0; }
.acc-dl dt { color: var(--muted); }
.acc-dl dd { overflow-wrap: anywhere; }

/* Formularios */
.acc-form { display: grid; gap: 14px; }
.acc-field { display: grid; gap: 6px; }
.acc-form label,
.acc-confirm label { font-weight: 700; font-size: .95rem; }
.acc-inline { display: flex; gap: 10px; }
.acc-inline input { flex: 1; min-width: 0; }

.acc-sheet input[type="text"],
.acc-sheet input[type="password"],
.acc-sheet input[type="email"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font: inherit;
}
.acc-sheet input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border: 1.5px solid transparent;
  border-radius: 50px;
  background: var(--start);
  color: #02101c;
  font: inherit; font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { border-color: var(--accent); filter: none; }
.btn-danger { background: var(--accent2); color: #1a0505; }

/* Mensajes de estado */
.acc-msg { min-height: 1.3em; font-size: .92rem; font-weight: 700; }
.acc-msg.is-ok { color: #4ade80; }
.acc-msg.is-error { color: #ff8a8a; }

/* Acciones secundarias */
.acc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.acc-sec .acc-link { color: var(--accent); }

/* Zona de eliminación */
.acc-danger {
  margin-top: 22px;
  border: 1.5px solid rgba(255,107,107,.45);
  border-radius: 10px;
}
.acc-danger > summary {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 800;
  color: var(--accent2);
  list-style-position: inside;
}
.acc-danger[open] > summary { border-bottom: 1px solid rgba(255,107,107,.3); }
.acc-danger form { display: grid; gap: 14px; padding: 16px; }
.acc-confirm { display: grid; gap: 6px; }
.acc-delpro { margin-top: 22px; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: 10px; }

/* ── Contraste (WCAG AA) ──
   Texto secundario más claro: var(--muted) da ≈4,4:1 sobre la tarjeta
   y #9db0d3 ≈6,5:1 (mismo tono que el paywall de auth.js).
   Bordes de campos y botón fantasma más visibles: #6683b3 ≈3,7:1. */
.page-wrapper { --acc-muted: #9db0d3; }
.acc-loading, .acc-email, .acc-since, .acc-note, .acc-dl dt { color: var(--acc-muted); }
.acc-sheet input[type="text"],
.acc-sheet input[type="password"],
.acc-sheet input[type="email"],
.btn-ghost { border-color: #6683b3; }
/* Va después de la regla anterior para que el foco siga marcando el borde */
.acc-sheet input:focus-visible { border-color: var(--accent); }

/* ── Móvil ── */
@media (max-width: 560px) {
  .acc-hero { padding: 18px; gap: 14px; }
  .acc-avatar { width: 60px; height: 60px; font-size: 1.6rem; }
  .acc-sec { padding: 18px; }
  .acc-dl > div { grid-template-columns: 1fr; gap: 0; }
  .acc-inline { flex-direction: column; }
  .acc-sec .btn { width: 100%; }
  .acc-actions .btn { flex: 1 1 100%; }
}
