/* Pantallas de cuenta: acceso, onboarding, perfil, ajustes y cuidadores.
   Las clases base (card, btn, chip, row, avatar, pf-photo, warn, tag, sub, icon-btn...) vienen de base.css,
   que sale de vista-previa/preview/preview.css. Aquí solo lo que esas pantallas añaden. */

/* ---------- contenedores ---------- */
.cuenta, .onb, .perfil, .ajustes, .cuid {
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 2px 24px;
}
.cuenta { padding-top: 24px; }
.cuenta-cab { text-align: left; margin: 4px 0 16px; }
.cuenta-marca {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--acc);
  margin: 0 0 6px;
}
.cuenta-titulo { font-size: 1.6rem; line-height: 1.15; margin: 0 0 6px; }
.cuenta-subtitulo { font-size: 1.15rem; margin: 0 0 8px; }
.cuenta-card { margin-top: 4px; }
.cuenta-nota { margin-top: 8px; }
.cuenta-links { text-align: center; margin: 14px 0 0; font-size: .9rem; color: var(--muted); }
.ancho { width: 100%; }

.enlace {
  border: 0;
  background: none;
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
  font: inherit;
  cursor: pointer;
  min-height: 44px;
  padding: 0 6px;
}
.enlace:focus-visible,
.clave-ver:focus-visible,
.switch:focus-visible,
.cuid-opcion input:focus-visible {
  outline: 3px solid var(--pfocus);
  outline-offset: 2px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.ajustes-padre:disabled { opacity: .72; }

/* ---------- campos ---------- */
.cuenta input:not([type=radio]):not([type=checkbox]):not([type=file]),
.onb input:not([type=radio]):not([type=checkbox]):not([type=file]),
.perfil input:not([type=radio]):not([type=checkbox]):not([type=file]),
.ajustes input:not([type=radio]):not([type=checkbox]):not([type=file]),
.cuid input:not([type=radio]):not([type=checkbox]):not([type=file]) {
  font: inherit;
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--fg);
}
.cuenta select, .onb select, .perfil select, .ajustes select, .cuid select {
  font: inherit;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--fg);
}
.cuenta input:focus, .onb input:focus, .perfil input:focus, .ajustes input:focus, .cuid input:focus,
.cuenta select:focus, .onb select:focus, .perfil select:focus, .ajustes select:focus, .cuid select:focus {
  outline: 3px solid color-mix(in srgb, var(--acc) 40%, transparent);
  outline-offset: 0;
  border-color: var(--acc);
}
input[readonly] { color: var(--muted); }
input:disabled, select:disabled, button:disabled { opacity: .6; }
.cuenta .f, .onb .f, .perfil .f, .ajustes .f, .cuid .f { margin-top: 14px; }

/* contraseña con botón mostrar/ocultar */
.clave { position: relative; }
.clave input { padding-right: 96px; }
.clave-ver {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 44px;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 12px;
  background: var(--soft);
  color: var(--fg);
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
}

/* indicador de fuerza */
.fuerza { margin-top: 8px; }
.fuerza-barra {
  height: 6px;
  border-radius: 999px;
  background: var(--soft);
  overflow: hidden;
}
.fuerza-barra span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--rojo);
  transition: width .2s ease;
}
.fuerza-barra span[data-nivel="2"] { background: var(--ambar); }
.fuerza-barra span[data-nivel="3"],
.fuerza-barra span[data-nivel="4"] { background: var(--verde); }
.fuerza .sub { margin-top: 6px; }

/* mensajes de formulario */
.cuenta-msg {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: .86rem;
  line-height: 1.4;
  color: var(--fg);
  background: color-mix(in srgb, var(--rojo) 16%, var(--card));
}
.cuenta-msg[data-tipo="info"] { background: color-mix(in srgb, var(--verde) 16%, var(--card)); }
.cuenta-msg[hidden] { display: none; }

/* separador y proveedores no disponibles */
.cuenta-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 12px;
  color: var(--muted);
  font-size: .8rem;
}
.cuenta-sep::before, .cuenta-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.cuenta .btn.ghost[disabled] { margin-top: 8px; }

/* ---------- onboarding ---------- */
.onb-paso {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}
.onb-cat { margin-bottom: 12px; }
.onb-cat legend { padding: 0; margin-bottom: 8px; width: 100%; }
.onb-cat legend h2 { font-size: 1.05rem; }
.onb-cat .chips { margin-top: 4px; }
.onb-cat .chip { min-height: 44px; }
.onb-acciones { position: sticky; bottom: 8px; background: var(--bg); padding: 8px 0; }

/* ---------- perfil ---------- */
.perfil-fila .tx { min-width: 0; flex: 1; }
.perfil-fila .tx b { display: block; }
.perfil-fila .btn.sm { min-height: 44px; }
.pf-photo { flex-wrap: wrap; }
.pf-photo .btn.sm { min-height: 44px; }
.pf .note { margin-top: 4px; }

/* ---------- ajustes ---------- */
.ajuste-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.ajuste-fila:first-of-type { border-top: 0; }
.ajuste-fila .tx { min-width: 0; flex: 1; font-size: .95rem; }
.ajuste-fila .tx p { margin-top: 2px; }
.ajuste-sub { font-size: .92rem; margin: 16px 0 6px; }
.ajustes select { margin-top: 4px; }
.ajustes .card > .sub { margin-bottom: 6px; }

.switch {
  position: relative;
  flex: none;
  width: 60px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.switch::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: 10px;
  bottom: 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--fg) 24%, var(--card));
  transition: background .2s ease;
}
.switch span {
  position: absolute;
  top: 10px;
  left: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .2s ease;
}
.switch[aria-checked="true"]::before { background: var(--acc2); }
.switch[aria-checked="true"] span { transform: translateX(24px); }

.alerta-suave {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--soft);
  font-size: .9rem;
  line-height: 1.45;
}
.alerta-suave h3 { font-size: 1rem; margin: 0 0 6px; }
.alerta-suave p { margin: 0 0 8px; }
.alerta-suave p:last-child { margin-bottom: 0; }

.lista-simple { margin: 6px 0 10px; padding-left: 20px; font-size: .9rem; line-height: 1.5; }
.lista-simple li { margin-bottom: 4px; }
.pendiente {
  padding: 1px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ambar) 26%, var(--card));
  font-weight: 600;
}

/* modo noche: tonos más cálidos y apagados (lo activa el interruptor de Ajustes) */
.look.modo-noche { filter: sepia(.22) brightness(.84); }

/* ---------- cuidadores ---------- */
.cuid-lista { list-style: none; margin: 0 0 12px; padding: 0; }
.cuid-fila {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.cuid-fila:first-child { border-top: 0; }
.cuid-datos { min-width: 0; flex: 1 1 180px; overflow-wrap: anywhere; }
.cuid-datos b { display: block; }
.cuid-datos .sub { display: block; }
.cuid-acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cuid-acciones select { width: auto; min-width: 150px; }
.cuid-conf { margin-top: 0; }
.cuid-canal { margin-top: 14px; border: 0; padding: 0; }
.cuid-canal legend.f { margin: 0 0 6px; padding: 0; }
.cuid-opcion {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: .95rem;
  cursor: pointer;
}
.cuid-opcion input { width: 20px; height: 20px; margin: 0; accent-color: var(--acc); }
#cuid-resultado:empty { display: none; }
#cuid-resultado .alerta-suave { margin-top: 14px; }

/* ---------- movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  .switch span, .switch::before, .fuerza-barra span { transition: none; }
}

/* ---------- pantallas estrechas ---------- */
@media (max-width: 360px) {
  .clave input { padding-right: 84px; }
  .clave-ver { padding: 0 8px; }
}
