/* Rediseño fase 5 (Task 8): Perfil. Valores de diseno/rediseno-oct/perfil-plantilla.html: el retrato neón con su polvo, el
   nombre y la carrera, las 3 cifras, «Compartir mi ficha» chico y los ajustes al final. Los @container app del prototipo son
   aquí @media. Accesibilidad de la app: texto de 12 px o más y botones de 44 px o más (el prototipo usaba 38 px). */
.rd-pf, .rd-pf *, .rd-ficha-capa, .rd-ficha-capa * { box-sizing: border-box; }
.rd-pf {
  --rd-line-2: color-mix(in srgb, var(--ink) 7%, transparent);
  max-width: 1240px; margin-inline: auto;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 34px;
  padding: 24px max(16px, env(safe-area-inset-right, 0px)) 120px max(16px, env(safe-area-inset-left, 0px));
  color: var(--ink);
}
.rd-pf h1, .rd-pf h2, .rd-pf p { margin: 0; }
.rd-pf button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.rd-pf .rd-ico, .rd-ficha-capa .rd-ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.rd-pf .boton, .rd-ficha-capa .boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: 999px;
  font-size: 15px; font-weight: 800; white-space: nowrap; text-decoration: none; transition: transform .1s, opacity .2s;
}
.rd-pf .boton:active, .rd-ficha-capa .boton:active { transform: scale(.97); }
.rd-pf .boton-sec { background: var(--rd-line-2); color: var(--ink); }

/* La ficha: retrato a la izquierda, datos a la derecha */
.rd-pf .rd-ficha { position: relative; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 32px; align-items: center; min-height: clamp(520px, 68vh, 680px); }
.rd-pf .retrato { position: relative; overflow: visible; aspect-ratio: 390 / 510; width: 100%; max-width: 440px; justify-self: center; }
.rd-pf .retrato canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rd-pf .retrato { isolation: isolate; }
.rd-pf .retrato .polvo { z-index: -1; }
:root[data-theme="light"] .rd-pf .polvo { display: none; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .rd-pf .polvo { display: none; } }
.rd-pf .retrato .polvo { inset: -60px; width: calc(100% + 120px); height: calc(100% + 120px); pointer-events: none; -webkit-mask-image: radial-gradient(closest-side, #000/*tema:fijo*/ 55%, transparent); mask-image: radial-gradient(closest-side, #000/*tema:fijo*/ 55%, transparent); }
.rd-pf .c-neon { filter: drop-shadow(0 0 6px rgba(212, 245, 123, .75)/*tema:fijo*/); transition: filter .3s; -webkit-mask-image: radial-gradient(62% 58% at 52% 44%, #000/*tema:fijo*/ 55%, transparent 100%); mask-image: radial-gradient(62% 58% at 52% 44%, #000/*tema:fijo*/ 55%, transparent 100%); }
:root[data-theme="light"] .rd-pf .c-neon { filter: brightness(.5) saturate(1.8) drop-shadow(0 0 4px rgba(94, 138, 18, .5)/*tema:fijo*/); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .rd-pf .c-neon { filter: brightness(.5) saturate(1.8) drop-shadow(0 0 4px rgba(94, 138, 18, .5)/*tema:fijo*/); } }
.rd-pf .c-foto { opacity: 0; -webkit-mask-image: radial-gradient(62% 58% at 52% 44%, #000/*tema:fijo*/ 55%, transparent 100%); mask-image: radial-gradient(62% 58% at 52% 44%, #000/*tema:fijo*/ 55%, transparent 100%); }
.rd-pf .foto-btn {
  position: absolute; right: 6%; bottom: 6%; z-index: 3; width: 48px; height: 48px; border-radius: 999px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px -8px rgba(212, 245, 123, .7)/*tema:fijo*/; cursor: pointer;
}
.rd-pf .foto-btn .rd-ico { width: 22px; height: 22px; }
.rd-pf .foto-quitar {
  position: absolute; left: 6%; bottom: 6%; z-index: 3; width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center;
  background: var(--surface); color: var(--ink-2); border: 1px solid var(--line);
}
.rd-pf .foto-quitar[hidden] { display: none; }
.rd-pf .foto-quitar .rd-ico { width: 20px; height: 20px; }
.rd-pf .foto-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.rd-pf .foto-btn:focus-within { outline: 2px solid var(--ink); outline-offset: 3px; }
.rd-pf .datos { display: grid; gap: 26px; align-content: center; }
.rd-pf .datos h1 { font-size: clamp(40px, 5vw, 64px); font-weight: 900; letter-spacing: -.04em; line-height: .95; overflow-wrap: anywhere; }
.rd-pf .meta-l { display: block; font-size: 16px; font-weight: 700; color: var(--ink-2); margin-top: 8px; }
.rd-pf button.meta-l { min-height: 44px; color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.rd-pf .cifras { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rd-pf .cifra b { display: block; font-size: clamp(44px, 5vw, 68px); font-weight: 900; letter-spacing: -.05em; line-height: .9; font-variant-numeric: tabular-nums; }
.rd-pf .cifra .rd-vacio { display: block; min-height: 44px; font-size: clamp(22px, 2.4vw, 30px); font-weight: 900; letter-spacing: -.02em; line-height: 1.05; color: var(--accent-text); text-decoration: underline; text-underline-offset: 4px; text-align: inherit; }
.rd-pf .cifra span { display: block; margin-top: 8px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.rd-pf .cifra.lima b { color: var(--accent-text); }
.rd-pf .compartir { justify-self: start; min-height: 44px; padding: 0 16px; font-size: 13px; }
.rd-pf .rd-perfil-logros { margin: 0; }
/* «Tu avance» (web v2, Task 13): el nivel y el XP con su riel hacia el siguiente, y los logros ganados como fichas */
.rd-pf .rd-pf-avance { display: grid; gap: 12px; }
.rd-pf .avance-fila { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.rd-pf .avance-nivel { display: flex; align-items: baseline; gap: 10px; }
.rd-pf .avance-nivel b { font-size: 28px; font-weight: 900; letter-spacing: -.03em; }
.rd-pf .avance-nivel span { font-size: 16px; font-weight: 700; color: var(--ink-2); }
.rd-pf .avance-xp { font-size: 20px; font-weight: 900; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.rd-pf .avance-riel { height: 8px; border-radius: 999px; background: var(--rd-line-2); overflow: hidden; }
.rd-pf .avance-riel i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.rd-pf .avance-falta { font-size: 13px; font-weight: 700; color: var(--ink-3); }
.rd-pf .avance-logros { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
.rd-pf .rd-pf-logro { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 700; }
.rd-pf .logro-ico { font-size: 16px; line-height: 1; }
/* Ajustes */
.rd-pf .rd-ajustes { display: grid; gap: 14px; }
.rd-pf .sub-tit { font-size: 22px; font-weight: 900; letter-spacing: -.02em; }
.rd-pf .ajustes { display: grid; border-radius: var(--r-xl, 24px); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.rd-pf .aj { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 60px; padding: 0 20px; border-top: 1px solid var(--rd-line-2); font-size: 16px; font-weight: 700; text-align: left; width: 100%; }
.rd-pf .aj:first-child { border-top: 0; }
.rd-pf .aj .der { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink-3); font-weight: 700; }
.rd-pf .aj .der > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-pf .pill { padding: 4px 12px; border-radius: 999px; background: var(--rd-line-2); color: var(--ink); font-size: 13px; font-weight: 800; }
.rd-pf .pill.ultra { background: var(--accent); color: var(--accent-ink); }
.rd-pf .aj.salir { color: var(--bad); }

/* La tarjeta real de invitaciones también aparece con sesión. Sus controles
   heredados conservan los mínimos de lectura y de toque del rediseño. */
.rd-pf .ref-tarjeta .u-eyebrow,
.rd-pf .ref-tarjeta .u-pathway small,
.rd-pf .ref-tarjeta .u-pathway li > span { font-size: 12px; }
.rd-pf .ref-tarjeta .u-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 44px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  font-size: 13px; font-weight: 800;
}
.rd-pf .ref-tarjeta .u-primary { background: var(--accent); color: var(--accent-ink); }
.rd-pf .ref-tarjeta .u-text { color: var(--accent-text); }

/* La ficha para compartir: una capa oscura sobre todo */
.rd-ficha-capa {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px;
  background: rgba(6, 8, 9, .78)/*tema:fijo*/; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
}
.rd-ficha-capa .capa-in { display: grid; gap: 16px; justify-items: center; max-height: 100%; }
.rd-ficha-capa img { width: auto; height: auto; max-height: min(72vh, 720px); max-width: 100%; border-radius: 22px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9)/*tema:fijo*/; }
.rd-ficha-capa p { margin: 0; font-size: 14px; font-weight: 700; color: #A4ABB0/*tema:fijo*/; text-align: center; }
.rd-ficha-capa .capa-acc { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.rd-ficha-capa .boton-principal { background: #D4F57B/*tema:fijo*/; color: #121510/*tema:fijo*/; }
.rd-ficha-capa .boton-sec { background: rgba(245, 245, 240, .12)/*tema:fijo*/; color: #F5F5F0/*tema:fijo*/; border: 0; cursor: pointer; font-family: inherit; }

@media (max-width: 900px) {
  .rd-pf .rd-ficha { grid-template-columns: minmax(0, 1fr); gap: 28px; min-height: 0; }
  .rd-pf .retrato { max-width: 320px; }
}
@media (max-width: 760px) {
  .rd-pf .retrato .polvo { inset: -20px 0; width: 100%; height: calc(100% + 40px); }
  .rd-pf .cifra b { font-size: 42px; }
  .rd-pf .cifra .rd-vacio { font-size: 20px; width: 100%; }
  .rd-pf .datos { justify-items: stretch; }
  .rd-pf .datos h1, .rd-pf .meta-l { text-align: center; }
  .rd-pf button.meta-l { justify-self: center; width: 100%; }
  .rd-pf .compartir { justify-self: center; }
  .rd-pf .cifra { text-align: center; }
}
/* Las tarjetas que referidos.js y arranque.js ponen tras la identidad, con el ancho de la página */
.rd-pf > .ref-tarjeta, .rd-pf > .arr-tarjeta { margin: 0; }
