/* Fase 2 — Página Perfil. Mismo mundo visual. */

.profile {
  max-width: 520px;
  margin: 0 auto;
  padding: calc(var(--s5) + env(safe-area-inset-top)) var(--s5) 140px;
}

.pf-header { margin-bottom: var(--s5); }
.pf-header h1 { font-size: clamp(1.75rem, 8vw, 2.125rem); line-height: 1.06; letter-spacing: -0.028em; font-weight: 700; }
.pf-header p { color: var(--text-2); font-size: 0.875rem; margin-top: 2px; }

.pf-identity {
  display: flex; align-items: center; gap: var(--s4);
  padding: var(--s5);
  border-radius: var(--r-lg);
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--hairline);
  box-shadow: var(--elevation);
  margin-bottom: var(--s6);
}
.pf-avatar {
  flex: none; width: 60px; height: 60px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--brand), var(--brand-deep));
  color: var(--on-brand); font-size: 1.5rem; font-weight: 800;
}
.pf-identity strong { font-size: 1.125rem; font-weight: 650; }
.pf-identity p { color: var(--text-3); font-size: 0.75rem; margin-top: 2px; }
.pf-badge {
  display: inline-block; margin-left: var(--s2);
  font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--brand); background: var(--brand-tint);
  padding: 3px 8px; border-radius: var(--r-pill);
}

.pf-section {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-3);
  margin: var(--s6) 0 var(--s2);
}
.pf-group {
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--hairline);
  overflow: hidden;
}
.pf-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  min-height: 52px; padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--hairline);
}
.pf-row:last-child { border-bottom: 0; }
.pf-row > span { color: var(--text-2); font-size: 0.875rem; }
.pf-row > span small { color: var(--text-3); font-size: 0.6875rem; }
.pf-row strong { font-size: 0.875rem; font-weight: 600; text-align: right; }
.pf-row--btn { width: 100%; text-align: left; }
.pf-row--btn svg { width: 16px; height: 16px; color: var(--text-3); }
.pf-row--btn:active { background: var(--surface-hi); }
.pf-help { color: var(--text-2); font-size: 0.8125rem; line-height: 1.5; padding: var(--s4); margin: 0; }
.pf-login { margin: var(--s4) 0; }
.pf-diagnostico { display: grid; gap: 0; }
.pf-diag-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  min-height: 44px; padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--hairline); font-size: 0.875rem;
}
.pf-diag-row:last-child { border-bottom: 0; }
.pf-diag-row span { color: var(--text-2); }
.pf-diag-row strong { color: var(--brand); }
.pf-diag-row strong.is-bad { color: #d67570; }
.pf-pasos { margin: var(--s3) 0; padding-left: var(--s6); color: var(--text-2); font-size: 0.8125rem; line-height: 1.6; }
.pf-pasos li { margin-bottom: var(--s2); }
.pf-diag-row small { color: var(--text-2); font-size: 0.75rem; }
.stamps-history { border-top: 1px solid var(--hairline); }
.pf-edit { display: grid; gap: var(--s2); padding: var(--s4); border-top: 1px solid var(--hairline); }
.pf-edit input {
  width: 100%; min-height: 44px; padding: 0 var(--s3);
  border-radius: var(--r-sm); border: 1px solid var(--hairline);
  background: var(--bg); color: var(--text); font: inherit;
}
.seal-fly {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%);
  z-index: 120; display: grid; place-items: center; pointer-events: none;
  animation: seal-pop 850ms cubic-bezier(0.2, 1.3, 0.3, 1) both;
}
.seal-fly__plus { font-size: 2.5rem; font-weight: 800; color: var(--brand); }
.seal-fly__star { font-size: 1.5rem; color: var(--brand); }
@keyframes seal-pop {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.4); }
  40% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
  100% { opacity: 0; transform: translate(-50%, -85%) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .stamp { transition: none; }
  .seal-fly { animation: seal-fade 850ms ease both; }
  @keyframes seal-fade { 0%{opacity:0} 30%{opacity:1} 100%{opacity:0} }
}
.stamps-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 12px; padding: 24px; box-sizing: border-box;
}
.stamp {
  display: grid; place-items: center;
  width: 44px; height: 44px; aspect-ratio: 1; justify-self: center;
  border-radius: 50%; border: 1px dashed var(--hairline);
  color: var(--text-2); font-size: 1.25rem; opacity: 0.45;
}
.stamp--on {
  border: 1px solid var(--brand); color: var(--on-brand);
  background: var(--brand); opacity: 1;
}

.pf-toggle {
  display: flex; align-items: center; gap: var(--s3);
  min-height: 60px; padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
}
.pf-toggle:last-child { border-bottom: 0; }
.pf-toggle__text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.pf-toggle__text strong { font-size: 0.875rem; font-weight: 600; }
.pf-toggle__text span { color: var(--text-3); font-size: 0.75rem; }
.pf-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.pf-switch {
  flex: none; width: 46px; height: 28px; border-radius: var(--r-pill);
  background: var(--surface-hi); border: 1px solid var(--hairline);
  position: relative; transition: background var(--dur-base) var(--spring-settle);
}
.pf-switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--text-2);
  transition: transform var(--dur-base) var(--spring-settle), background var(--dur-base) ease;
}
.pf-toggle input:checked + .pf-switch { background: var(--brand); border-color: var(--brand); }
.pf-toggle input:checked + .pf-switch::after { transform: translateX(18px); background: var(--on-brand); }
.pf-toggle input:focus-visible + .pf-switch { outline: 2px solid var(--brand); outline-offset: 2px; }

.pf-actions { display: flex; flex-direction: column; gap: var(--s3); margin-top: var(--s6); }
.pf-logout, .pf-delete {
  min-height: var(--tap); border-radius: var(--r-pill);
  font-size: 0.875rem; font-weight: 600;
  transition: transform var(--dur-fast) var(--spring-snap);
}
.pf-logout:active, .pf-delete:active { transform: scale(0.98); }
.pf-logout { background: var(--surface-hi); border: 1px solid var(--hairline); color: var(--text); }
.pf-delete { background: transparent; border: 1px solid rgba(214, 92, 86, 0.4); color: #d67570; }

@media (prefers-reduced-motion: reduce) {
  .pf-switch, .pf-switch::after { transition: none; }
}
