/*
 * Perfil del facilitador (/cuenta) y Modificar cuenta (/cuenta/editar), como el menú de Facebook:
 * avatar, nombre y correo arriba; tarjetas de vidrio por sección (título encima, filas dentro).
 * Usa la columna y el encabezado del detalle de un test (test-detail.css); los interruptores de
 * los ajustes (js/components/account-settings.js) están al final.
 */
.profile__main {
  display: grid;
  gap: var(--space-6);
  align-content: start;
  padding-block: var(--space-6) var(--space-8);
}

.profile__title {
  font-size: var(--text-title);
  font-weight: var(--weight-black);
  line-height: var(--text-display-leading);
  letter-spacing: var(--text-display-tracking);
}

/* ------------------------------------------------------------------
 * Encabezado: avatar grande, nombre y correo.
 * ------------------------------------------------------------------ */
.profile__hero {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.profile .profile__avatar {
  width: 72px;
  height: 72px;
}

.profile__avatar .avatar__icon {
  width: 30px;
  height: 30px;
  stroke-width: 1.5;
}

.profile__identity {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.profile__name {
  font-size: 1.5rem;
  font-weight: var(--weight-regular);
  line-height: 1.15;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.profile__email {
  color: var(--brand-text-muted);
  font-size: var(--text-small);
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------
 * Secciones: título y tarjeta de vidrio.
 * ------------------------------------------------------------------ */
.profile__section {
  display: grid;
  gap: var(--space-2);
}

.profile__section-title {
  padding-inline: var(--space-1);
  color: var(--brand-text-muted);
  font-size: var(--text-small);
  font-weight: var(--weight-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile__card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--brand-glass-border);
  border-radius: var(--brand-radius-panel);
  background: var(--brand-glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.profile__note {
  color: var(--brand-text-muted);
  font-size: var(--text-small);
  line-height: var(--text-small-leading);
}

.profile__section > .profile__note {
  padding-inline: var(--space-1);
}

.profile__card > .profile__note {
  padding-block: var(--space-1);
}

.profile__suboptions {
  display: grid;
  gap: var(--space-3);
  padding-left: var(--space-4);
  border-left: 2px solid var(--brand-glass-border);
}

.profile__suboptions[hidden] {
  display: none;
}

.profile__status:empty {
  display: none;
}

.profile__status {
  color: var(--brand-error);
  font-size: var(--text-small);
  line-height: var(--text-small-leading);
}

/* Fila que abre otra pantalla ("Modificar cuenta") o hace una acción ("Cerrar sesión"). */
.profile__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  /* El fondo al tocar llega casi al borde de la tarjeta. */
  width: calc(100% + 2 * var(--space-2));
  min-height: 56px;
  margin-inline: calc(-1 * var(--space-2));
  padding: var(--space-2);
  border: 0;
  border-radius: var(--brand-radius-field);
  background: none;
  color: var(--brand-text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 160ms var(--vt-ease);
}

.profile__row:focus-visible {
  outline: 2px solid var(--brand-sky);
  outline-offset: 0;
}

@media (hover: hover) {
  .profile__row:hover {
    background: var(--brand-link-bg);
  }
}

.profile__row:active {
  background: var(--brand-link-bg);
}

.profile__row:disabled {
  cursor: progress;
  opacity: 0.7;
}

.profile__row-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--brand-link-bg);
}

.profile__row-icon .icon {
  width: 22px;
  height: 22px;
}

.profile__row-text {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.profile__row-label {
  font-weight: var(--weight-semibold);
  line-height: 1.3;
}

.profile__row-hint {
  color: var(--brand-text-muted);
  font-size: var(--text-small);
  line-height: 1.3;
}

.profile__row-chevron {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--brand-text-muted);
}

/* ------------------------------------------------------------------
 * Modificar cuenta: formularios dentro de las tarjetas.
 * ------------------------------------------------------------------ */
.account-edit__card {
  gap: var(--space-5);
  padding: var(--space-5) var(--space-4);
}

.account-edit__hint {
  margin-top: calc(-1 * var(--space-1));
  color: var(--brand-text-muted);
  font-size: var(--text-small);
  line-height: 1.4;
}

.account-edit__notice {
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  line-height: var(--text-small-leading);
}

.account-edit__notice[hidden] {
  display: none;
}

.account-edit__notice[data-kind="error"] {
  color: var(--brand-error);
}

.account-edit__notice[data-kind="ok"] {
  color: var(--wound-none-ink);
}

/* ------------------------------------------------------------------
 * Interruptores de los ajustes (bloqueo y notificaciones).
 * ------------------------------------------------------------------ */
.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--tap-min);
}

.setting__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.setting__label {
  font-weight: var(--weight-semibold);
  line-height: 1.35;
}

.setting__hint {
  color: var(--brand-text-muted);
  font-size: var(--text-small);
  line-height: 1.4;
}

/* Interruptor (role="switch"): pista de 52×32 dentro de un área táctil de 48 px de alto. */
.setting__switch {
  position: relative;
  flex: none;
  width: 52px;
  height: var(--tap-min);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.setting__switch::before {
  content: "";
  position: absolute;
  inset: 8px 0;
  border-radius: var(--radius-pill);
  background: var(--brand-glass-border-strong);
  transition: background-color 160ms var(--vt-ease);
}

.setting__thumb {
  position: absolute;
  top: 11px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.25);
  transition: transform 160ms var(--vt-ease);
}

.setting__switch[aria-checked="true"]::before {
  background: var(--brand-sky);
}

.setting__switch[aria-checked="true"] .setting__thumb {
  transform: translateX(20px);
}

.setting__switch:disabled {
  cursor: progress;
  opacity: 0.6;
}

.setting__switch:focus-visible {
  outline: none;
}

.setting__switch:focus-visible::before {
  outline: 2px solid var(--brand-sky);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .setting__switch::before,
  .setting__thumb {
    transition: none;
  }
}
