/* ============================================================
   PORTAL DEL ALUMNO — hoja propia
   Se apoya en las variables de app.css (crema / tinta / coral).
   ============================================================ */

.pt-body {
  background: var(--cream);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: var(--ink);
  margin: 0;
  padding-bottom: 86px;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Cabecera ---------- */
.pt-head {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 11px 16px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--cream-2);
  padding-top: max(11px, env(safe-area-inset-top));
}
.pt-logo img { height: 34px; width: auto; display: block; }
.pt-head-r { display: flex; gap: 6px; }
.pt-ico {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-2); transition: background .15s;
}
.pt-ico:hover { background: var(--cream-2); }

.pt-main { max-width: 620px; margin: 0 auto; padding: 16px 14px 28px; }
.pt-main.wide { max-width: 980px; }
.pt-h1 { font-size: 1.5rem; margin: 4px 0 18px; }

/* ---------- Navegación inferior ---------- */
.pt-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--cream-2);
  padding: 7px 6px max(7px, env(safe-area-inset-bottom));
}
.pt-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 4px; border-radius: 12px;
  font-size: .68rem; font-weight: 600; color: var(--ink-3);
  transition: color .15s, background .15s;
}
.pt-nav a.on { color: var(--coral); background: var(--coral-wash); }
.pt-nav a:active { background: var(--cream-2); }

/* ---------- Acceso ---------- */
.pt-login {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px 16px;
}
.pt-login-card {
  background: #fff; border-radius: 22px; padding: 32px 26px;
  width: 100%; max-width: 390px;
  box-shadow: 0 14px 40px rgba(36, 26, 40, .12);
}

/* ---------- Cabecera del perfil ---------- */
.pt-profile {
  background: #fff; border-radius: 20px; overflow: hidden;
  box-shadow: var(--sh); margin-bottom: 16px;
}
.pt-cover {
  height: 124px;
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-dark) 55%, var(--ink) 100%);
  background-size: cover; background-position: center;
}
.pt-profile-in {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; padding: 0 20px; margin-top: -38px;
}
.pt-ava {
  width: 92px; height: 92px; border-radius: 50%; flex: none;
  border: 4px solid #fff; background: var(--cream-2); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-4); box-shadow: 0 3px 12px rgba(36, 26, 40, .14);
}
.pt-ava img { width: 100%; height: 100%; object-fit: cover; }
.pt-ava-ph { display: flex; align-items: center; justify-content: center; }
.pt-stats { display: flex; gap: 22px; padding-bottom: 8px; }
.pt-stats div { text-align: center; }
.pt-stats strong { display: block; font-size: 1.12rem; font-weight: 800; line-height: 1.1; }
.pt-stats span { font-size: .7rem; color: var(--ink-3); }
.pt-bio { padding: 14px 20px 20px; }
.pt-bio h1 { font-size: 1.22rem; margin: 0 0 7px; }
.pt-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

/* ---------- Tarjeta de suscripción ---------- */
.pt-sub {
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-dark) 100%);
  color: #fff; border-radius: 18px; padding: 18px 20px; margin-bottom: 16px;
  box-shadow: 0 8px 22px rgba(232, 96, 76, .26);
}
.pt-bar {
  height: 7px; background: rgba(255, 255, 255, .26);
  border-radius: 99px; overflow: hidden; margin-top: 14px;
}
.pt-bar span { display: block; height: 100%; background: #fff; border-radius: 99px; }
.pt-warn {
  margin-top: 12px; background: rgba(0, 0, 0, .18); border-radius: 10px;
  padding: 9px 12px; font-size: .79rem; display: flex; gap: 7px; align-items: center;
}

/* ---------- Secciones ---------- */
.pt-sec { margin-bottom: 20px; }
.pt-sec h2 { font-size: 1.02rem; margin: 0 0 11px; }

.pt-kpis {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px;
}
.pt-kpis div {
  background: #fff; border-radius: 15px; padding: 15px 10px;
  text-align: center; box-shadow: var(--sh-sm);
}
.pt-kpis strong { display: block; font-size: 1.45rem; font-weight: 800; line-height: 1.1; }
.pt-kpis span { font-size: .71rem; color: var(--ink-3); }

/* Filas tipo lista */
.pt-row {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: 14px; padding: 12px 14px;
  margin-bottom: 8px; box-shadow: var(--sh-sm);
}
.pt-row-d {
  width: 44px; flex: none; text-align: center;
  background: var(--coral-wash); color: var(--coral);
  border-radius: 11px; padding: 6px 0;
}
.pt-row-d.sage { background: var(--sage-wash); color: var(--sage); }
.pt-row-d strong { display: block; font-size: 1.05rem; line-height: 1; }
.pt-row-d span { font-size: .62rem; text-transform: uppercase; letter-spacing: .04em; }

/* Logros */
.pt-chips { display: flex; gap: 9px; overflow-x: auto; padding-bottom: 4px; }
.pt-chip {
  display: flex; align-items: center; gap: 9px; flex: none;
  background: #fff; border-radius: 13px; padding: 10px 13px; box-shadow: var(--sh-sm);
}

/* Publicar */
.pt-publish { background: #fff; border-radius: 16px; padding: 14px; box-shadow: var(--sh-sm); }
.pt-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7px; padding: 26px 14px; border: 2px dashed var(--cream-3);
  border-radius: 13px; cursor: pointer; color: var(--ink-3);
  font-size: .85rem; text-align: center; transition: border-color .15s, background .15s;
}
.pt-drop:hover { border-color: var(--coral); background: var(--coral-wash); color: var(--coral); }
.pt-drop input { display: none; }
#pub-prev { width: 100%; border-radius: 12px; margin-top: 10px; display: block; }

/* Muro */
.pt-feed { display: flex; flex-direction: column; gap: 14px; }
.pt-post { background: #fff; border-radius: 17px; overflow: hidden; box-shadow: var(--sh); }
.pt-post > img { width: 100%; display: block; }
.pt-post-b { padding: 13px 16px 14px; }
.pt-post-b p { margin: 0; font-size: .91rem; line-height: 1.5; }
.pt-del {
  background: none; border: 0; color: var(--ink-4); cursor: pointer;
  padding: 4px; border-radius: 7px; display: inline-flex;
}
.pt-del:hover { color: var(--danger); background: var(--danger-wash); }

/* Rejilla de fotos */
.pt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.pt-cell {
  display: block; aspect-ratio: 1; border-radius: 9px; overflow: hidden;
  background: var(--cream-2); position: relative;
}
.pt-cell img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.pt-cell:hover img { transform: scale(1.05); }
.pt-cell .tag {
  position: absolute; right: 5px; bottom: 5px;
  background: rgba(0, 0, 0, .62); color: #fff;
  font-size: .64rem; font-weight: 700; padding: 2px 6px; border-radius: 6px;
}

/* Anillo de progreso */
.pt-ring {
  position: relative; background: linear-gradient(135deg, var(--ink) 0%, #3d2f42 100%);
  color: #fff; border-radius: 20px; padding: 22px;
  display: flex; align-items: center; gap: 20px; margin-bottom: 20px;
}
.pt-ring svg { width: 96px; height: 96px; flex: none; transform: rotate(-90deg); }
.pt-ring-c {
  position: absolute; left: 22px; width: 96px; height: 96px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.pt-ring-c strong { font-size: 1.28rem; font-weight: 800; line-height: 1; }
.pt-ring-c span { font-size: .58rem; opacity: .75; }
.pt-ring-t { flex: 1; }

/* Escalera de galopes */
.pt-steps { display: flex; gap: 5px; }
.pt-step { flex: 1; text-align: center; }
.pt-step span {
  display: flex; align-items: center; justify-content: center;
  width: 100%; aspect-ratio: 1; max-width: 42px; margin: 0 auto 5px;
  border-radius: 50%; background: var(--cream-2); color: var(--ink-4);
  font-weight: 700; font-size: .82rem;
}
.pt-step.done span { background: var(--sage); color: #fff; }
.pt-step.now span { background: var(--coral); color: #fff; box-shadow: 0 0 0 4px var(--coral-wash); }
.pt-step .tiny { color: var(--ink-3); font-size: .63rem; }

/* ---------- Tienda de fotos ---------- */
.ph-head {
  background: #fff; border-radius: 18px; padding: 20px 22px;
  box-shadow: var(--sh); margin-bottom: 18px;
}
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 11px; }
.ph-card {
  position: relative; border-radius: 13px; overflow: hidden;
  background: var(--cream-2); aspect-ratio: 3/2; cursor: pointer;
  box-shadow: var(--sh-sm); transition: transform .2s, box-shadow .2s;
}
.ph-card:hover { transform: translateY(-3px); box-shadow: var(--sh); }
.ph-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-card .ph-ov {
  position: absolute; inset: 0; display: flex; align-items: flex-end;
  justify-content: space-between; gap: 8px; padding: 9px 11px;
  background: linear-gradient(to top, rgba(0, 0, 0, .58), transparent 55%);
  opacity: 0; transition: opacity .2s;
}
.ph-card:hover .ph-ov, .ph-card.sel .ph-ov { opacity: 1; }
.ph-card .ph-price {
  background: #fff; color: var(--ink); font-weight: 800;
  font-size: .78rem; padding: 3px 9px; border-radius: 99px;
}
.ph-card .ph-pick {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: rgba(255, 255, 255, .92); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.ph-card.sel { outline: 3px solid var(--coral); outline-offset: -3px; }
.ph-card.sel .ph-pick { background: var(--coral); color: #fff; }
.ph-card.owned::after {
  content: "Comprada"; position: absolute; top: 8px; left: 8px;
  background: var(--ok); color: #fff; font-size: .64rem; font-weight: 700;
  padding: 3px 8px; border-radius: 99px;
}

/* Barra de compra fija */
.ph-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  background: var(--ink); color: #fff;
  padding: 13px 18px max(13px, env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  transform: translateY(110%); transition: transform .25s cubic-bezier(.2, .8, .3, 1);
}
.ph-bar.on { transform: translateY(0); }
.ph-bar .n { font-size: .86rem; }
.ph-bar strong { font-size: 1.12rem; }

/* Visor */
.ph-view {
  position: fixed; inset: 0; z-index: 90; background: rgba(18, 14, 20, .94);
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.ph-view.on { display: flex; }
.ph-view img { max-width: 100%; max-height: 82vh; border-radius: 10px; }
.ph-view .x {
  position: absolute; top: 14px; right: 16px; width: 40px; height: 40px;
  border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16);
  color: #fff; font-size: 22px; cursor: pointer;
}
.ph-view .cap {
  position: absolute; bottom: 20px; left: 0; right: 0; text-align: center;
  color: rgba(255, 255, 255, .8); font-size: .8rem;
}

@media (max-width: 420px) {
  .pt-stats { gap: 15px; }
  .pt-ava { width: 78px; height: 78px; }
  .ph-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}
