/* ====================== RESET & BASE ====================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --c-pink:   #ff85a2;
  --c-yellow: #ffd166;
  --c-mint:   #06d6a0;
  --c-blue:   #4cc9f0;
  --c-purple: #9b5de5;
  --c-coral:  #ff8c61;
  --c-ink:    #3a2e5c;
  --c-soft:   #6b5e8a;
  --bg:       #fff7fb;
  --card:     #ffffff;
  --shadow:   0 14px 40px rgba(123, 90, 175, 0.16);
  --radius:   26px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--c-ink);
  background:
    radial-gradient(circle at 12% 8%, #ffe6f0 0, transparent 36%),
    radial-gradient(circle at 88% 18%, #e3f6ff 0, transparent 34%),
    radial-gradient(circle at 50% 100%, #eafff7 0, transparent 40%),
    var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, .nav-brand, .cover-badge, .card-date { font-family: 'Baloo 2', cursive; }

/* ====================== NAVBAR ====================== */
.navbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1.5rem;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(123,90,175,0.10);
}
.nav-brand { display: flex; align-items: center; gap: 0.5rem; font-size: 1.3rem; font-weight: 800; color: var(--c-purple); text-decoration: none; }
.nav-logo { font-size: 1.6rem; }
.nav-links { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.nav-links a {
  text-decoration: none; color: var(--c-soft); font-weight: 700;
  padding: 0.4rem 0.9rem; border-radius: 999px; transition: all .2s; font-size: 0.95rem;
}
.nav-links a:hover { background: var(--c-yellow); color: var(--c-ink); transform: translateY(-2px); }
.nav-toggle { display: none; background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--c-purple); }

/* ====================== PORTADA / COVER ====================== */
.cover {
  position: relative; min-height: 92vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; overflow: hidden;
  background: linear-gradient(160deg, #ffd6e8 0%, #d8c2ff 45%, #bfe9ff 100%);
}
.cover-inner { position: relative; z-index: 3; padding: 3rem 1.5rem 6rem; max-width: 900px; }
.cover-badge {
  display: inline-block; background: var(--c-pink); color: #fff;
  padding: 0.45rem 1.4rem; border-radius: 999px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; font-size: 0.9rem;
  box-shadow: 0 6px 18px rgba(255,133,162,0.5); margin-bottom: 1.4rem;
}
.cover-title {
  font-size: clamp(1.9rem, 5vw, 3.4rem); line-height: 1.12; color: #fff;
  text-shadow: 0 4px 16px rgba(123,90,175,0.35); font-weight: 800;
}
.cover-sub { margin-top: 1rem; font-size: clamp(1rem, 2.4vw, 1.35rem); color: #5a3d7a; font-weight: 700; }

.cover-illustration { position: relative; height: 150px; margin: 1.5rem 0 0.5rem; }
.cover-illustration .kid { position: absolute; font-size: 4rem; animation: bob 3s ease-in-out infinite; }
.kid.k1 { left: 22%; top: 10px; animation-delay: 0s; }
.kid.k2 { left: 45%; top: -6px; font-size: 4.6rem; animation-delay: .5s; }
.kid.k3 { left: 66%; top: 12px; animation-delay: 1s; }
.blocks { position: absolute; bottom: -6px; width: 100%; font-size: 1.8rem; letter-spacing: 0.6rem; opacity: 0.95; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-14px) rotate(2deg); } }

/* ----- Perfil de la docente en la portada ----- */
.cover-profile {
  display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; justify-content: center;
  margin: 1.4rem auto 0; max-width: 720px;
  background: rgba(255,255,255,0.55); backdrop-filter: blur(6px);
  border-radius: 24px; padding: 1.1rem 1.4rem; box-shadow: 0 12px 30px rgba(123,90,175,0.22);
}
.cover-photo {
  position: relative; flex: 0 0 auto;
  width: 132px; height: 132px; border-radius: 50%;
  border: 5px solid #fff; overflow: hidden; background: #f3edfb;
  box-shadow: 0 8px 22px rgba(123,90,175,0.3);
  display: grid; place-items: center;
}
.cover-photo img { width: 100%; height: 100%; object-fit: cover; }
.cover-photo-empty { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; color: #b9a9cf; font-size: 1.8rem; font-weight: 700; }
.cover-photo-empty span { font-size: 0.6rem; text-transform: uppercase; letter-spacing: .5px; }
.cover-photo-btn {
  position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  font-size: 0.68rem; padding: 0.3rem 0.7rem; white-space: nowrap;
}
.cover-profile-info { text-align: left; max-width: 420px; }
.cover-profile-tag {
  display: inline-block; background: var(--c-purple); color: #fff;
  padding: 0.2rem 0.8rem; border-radius: 999px; font-weight: 800; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 0.5rem;
}
.cover-creds { list-style: none; display: flex; flex-direction: column; gap: 0.35rem; }
.cover-creds li {
  background: #fff; color: var(--c-ink); font-weight: 700; font-size: 0.92rem;
  padding: 0.45rem 0.8rem; border-radius: 12px; box-shadow: 0 4px 12px rgba(123,90,175,0.12);
}

.cover-cta {
  display: inline-block; margin-top: 1.6rem;
  background: var(--c-mint); color: #04392c; text-decoration: none;
  font-weight: 800; font-size: 1.1rem; padding: 0.9rem 2.2rem; border-radius: 999px;
  box-shadow: 0 10px 26px rgba(6,214,160,0.45); transition: transform .2s, box-shadow .2s;
}
.cover-cta:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 14px 32px rgba(6,214,160,0.55); }

/* clouds */
.cloud { position: absolute; background: #fff; border-radius: 100px; opacity: .7; filter: blur(2px); }
.cloud::before, .cloud::after { content:''; position:absolute; background:#fff; border-radius:50%; }
.cloud.c1 { width: 120px; height: 38px; top: 14%; left: 10%; animation: drift 22s linear infinite; }
.cloud.c2 { width: 90px; height: 30px; top: 26%; right: 12%; animation: drift 28s linear infinite reverse; }
.cloud.c3 { width: 150px; height: 44px; top: 60%; left: 16%; animation: drift 34s linear infinite; }
.cloud.c1::before { width:50px; height:50px; top:-22px; left:18px; } .cloud.c1::after { width:36px; height:36px; top:-14px; right:18px; }
.cloud.c2::before { width:40px; height:40px; top:-18px; left:14px; } .cloud.c2::after { width:30px; height:30px; top:-10px; right:14px; }
.cloud.c3::before { width:60px; height:60px; top:-26px; left:22px; } .cloud.c3::after { width:44px; height:44px; top:-18px; right:22px; }
@keyframes drift { from { transform: translateX(-40px); } to { transform: translateX(40px); } }

.cover-wave { position: absolute; bottom: -1px; left: 0; width: 100%; line-height: 0; z-index: 2; }
.cover-wave svg { width: 100%; height: 110px; }
.cover-wave path { fill: var(--bg); }

/* ====================== INTRO ====================== */
.intro { max-width: 820px; margin: 2.5rem auto 0; padding: 0 1.5rem; text-align: center; }
.intro p { font-size: 1.1rem; color: var(--c-soft); }
.intro strong { color: var(--c-purple); }

/* ====================== TIMELINE ====================== */
.timeline { position: relative; max-width: 1080px; margin: 3rem auto 4rem; padding: 1rem 1.2rem; }

/* Dibujos decorativos de primera infancia (de fondo, no interfieren con clics) */
.tl-decor { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.tl-decor .decor { position: absolute; width: 84px; opacity: 0.5; animation: floaty 6s ease-in-out infinite; }
.tl-decor .d1 { top: 4%;  left: -2%;  animation-delay: 0s;   }
.tl-decor .d2 { top: 22%; right: -1%; width: 96px; animation-delay: 1.2s; }
.tl-decor .d3 { top: 46%; left: -3%;  width: 90px; animation-delay: .6s; }
.tl-decor .d4 { top: 64%; right: -2%; width: 92px; animation-delay: 1.8s; }
.tl-decor .d5 { top: 82%; left: -2%;  width: 88px; animation-delay: .9s; }
.tl-decor .d6 { top: 92%; right: 0%;  width: 96px; animation-delay: 1.5s; }
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-16px) rotate(3deg); } }
.tl-item, .card, .tl-dot { position: relative; z-index: 1; }
.timeline::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 6px;
  transform: translateX(-50%); border-radius: 999px;
  background: repeating-linear-gradient(var(--c-purple) 0 18px, transparent 18px 30px);
  opacity: 0.35;
}

.tl-item { position: relative; width: 50%; padding: 1.2rem 2.4rem; }
.tl-item.left { left: 0; }
.tl-item.right { left: 50%; }

.tl-dot {
  position: absolute; top: 1.6rem; z-index: 4;
  width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center; font-family: 'Baloo 2'; font-weight: 800; font-size: 1.3rem;
  color: #fff; background: var(--c-pink); border: 5px solid var(--bg);
  box-shadow: 0 6px 16px rgba(255,133,162,0.5);
}
.tl-item.left  .tl-dot { right: -25px; }
.tl-item.right .tl-dot { left: -25px; }
.tl-item.right .tl-dot { background: var(--c-blue); box-shadow: 0 6px 16px rgba(76,201,240,0.5); }
#unidad-3 .tl-dot { background: var(--c-mint); box-shadow: 0 6px 16px rgba(6,214,160,0.5); }
#reflexion .tl-dot { background: var(--c-coral); box-shadow: 0 6px 16px rgba(255,140,97,0.5); }

/* ====================== CARD ====================== */
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .25s;
  opacity: 0; transform: translateY(30px);
}
.card.reveal { opacity: 1; transform: translateY(0); }
.card:hover { transform: translateY(-4px); }

.card-head { padding: 1.5rem 1.6rem 1.3rem; color: #fff; position: relative; }
.head-1 { background: linear-gradient(135deg, var(--c-pink), var(--c-purple)); }
.head-2 { background: linear-gradient(135deg, var(--c-blue), var(--c-purple)); }
.head-3 { background: linear-gradient(135deg, var(--c-mint), var(--c-blue)); }
.head-4 { background: linear-gradient(135deg, var(--c-coral), var(--c-pink)); }
.card-date {
  display: inline-block; background: rgba(255,255,255,0.28); padding: 0.25rem 0.9rem;
  border-radius: 999px; font-size: 0.85rem; font-weight: 700; margin-bottom: 0.5rem;
}
.card-head h2 { font-size: 1.8rem; line-height: 1.1; }
.card-subtitle { font-size: 1rem; font-weight: 700; opacity: 0.95; margin-top: 0.2rem; }
.card-body { padding: 1.3rem 1.4rem 1.6rem; }

/* ====================== MODULE ====================== */
.module { padding: 1.1rem 0; border-bottom: 2px dashed #f0e6f7; }
.module:last-child { border-bottom: none; padding-bottom: 0.2rem; }
.module-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.module-head h3 { font-size: 1.18rem; color: var(--c-ink); }
.module-desc { color: var(--c-soft); font-size: 0.95rem; margin: 0.35rem 0 0.8rem; }

.btn {
  border: none; cursor: pointer; font-family: 'Nunito'; font-weight: 800;
  padding: 0.5rem 1.1rem; border-radius: 999px; font-size: 0.9rem;
  transition: transform .15s, box-shadow .15s; white-space: nowrap;
}
.btn:active { transform: scale(0.95); }
.btn-upload { background: var(--c-yellow); color: #6b4d00; box-shadow: 0 5px 14px rgba(255,209,102,0.5); }
.btn-upload:hover { transform: translateY(-2px); }
.btn-save { background: var(--c-mint); color: #04392c; box-shadow: 0 5px 14px rgba(6,214,160,0.4); }
.btn-save:hover { transform: translateY(-2px); }

.empty { color: #b9a9cf; font-style: italic; text-align: center; padding: 1.2rem; font-size: 0.95rem; }

/* ====================== GALLERY ====================== */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.7rem; }
.gallery .thumb {
  position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden;
  cursor: pointer; box-shadow: 0 5px 14px rgba(123,90,175,0.18); background: #f3edfb;
}
.gallery .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery .thumb:hover img { transform: scale(1.08); }

/* delete button shared */
.del {
  position: absolute; top: 6px; right: 6px; z-index: 3;
  width: 26px; height: 26px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(58,46,92,0.78); color: #fff; font-size: 0.85rem; line-height: 1;
  display: grid; place-items: center; opacity: 0; transition: opacity .2s;
}
.thumb:hover .del, .pdf-card:hover .del, .video-card:hover .del { opacity: 1; }

/* ====================== PDF ====================== */
.pdf-list { display: flex; flex-direction: column; gap: 1rem; }
.pdf-card { position: relative; border: 2px solid #efe6f8; border-radius: 18px; overflow: hidden; background: #faf6ff; }
.pdf-card .pdf-name {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1rem; font-weight: 700;
  background: #f1e7fb; color: var(--c-ink); font-size: 0.95rem;
}
.pdf-card .pdf-name .open { margin-left: auto; font-size: 0.82rem; color: var(--c-purple); text-decoration: none; font-weight: 800; }
.pdf-card embed, .pdf-card iframe { width: 100%; height: 480px; border: none; display: block; background: #fff; }

/* ====================== VIDEO ====================== */
.video-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.video-card { position: relative; border-radius: 16px; overflow: hidden; box-shadow: 0 6px 16px rgba(123,90,175,0.18); background: #000; }
.video-card video { width: 100%; display: block; border-radius: 16px; }

/* ====================== REFLEXION TEXT ====================== */
.reflexion-text {
  width: 100%; min-height: 160px; resize: vertical; margin-top: 0.4rem;
  border: 2px solid #ead9f7; border-radius: 16px; padding: 1rem;
  font-family: 'Nunito'; font-size: 1rem; color: var(--c-ink); background: #fffdff;
}
.reflexion-text:focus { outline: none; border-color: var(--c-purple); box-shadow: 0 0 0 4px rgba(155,93,229,0.15); }
.save-hint { display: inline-block; margin-top: 0.5rem; font-weight: 700; color: var(--c-mint); font-size: 0.9rem; }

/* ====================== EDITOR DE TEXTO ENRIQUECIDO ====================== */
.rte-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center;
  background: #f6eefc; border: 2px solid #ead9f7; border-bottom: none;
  border-radius: 16px 16px 0 0; padding: 0.45rem 0.55rem; margin-top: 0.4rem;
}
.rte-toolbar select, .rte-toolbar button {
  font-family: 'Nunito'; font-weight: 700; font-size: 0.88rem; cursor: pointer;
  border: 1.5px solid #e0cff2; background: #fff; color: var(--c-ink);
  border-radius: 9px; padding: 0.3rem 0.55rem; line-height: 1.1; transition: background .15s, transform .1s;
}
.rte-toolbar button:hover, .rte-toolbar select:hover { background: #f1e7fb; }
.rte-toolbar button:active { transform: scale(0.93); }
.rte-toolbar input[type="color"] {
  width: 34px; height: 30px; padding: 2px; border: 1.5px solid #e0cff2; border-radius: 9px;
  background: #fff; cursor: pointer;
}

.rte-editor {
  min-height: 130px; border: 2px solid #ead9f7; border-radius: 0 0 16px 16px;
  padding: 0.9rem 1rem; font-family: 'Nunito'; font-size: 1rem; color: var(--c-ink);
  background: #fffdff; line-height: 1.6; overflow-wrap: break-word;
}
.rte-editor:focus { outline: none; border-color: var(--c-purple); box-shadow: 0 0 0 4px rgba(155,93,229,0.15); }
.rte-editor[contenteditable="true"]:empty:before {
  content: attr(data-ph); color: #b9a9cf; pointer-events: none;
}
.rte-editor ul { padding-left: 1.4rem; }
.rte-editor a { color: var(--c-purple); }

/* Vista de SOLO LECTURA (visitante): se ve como texto, sin marco de editor */
.rte-readonly {
  border: none !important; background: transparent !important; padding: 0.2rem 0 !important;
  min-height: auto; box-shadow: none !important;
}
.rte-empty { color: #b9a9cf; font-style: italic; }

/* ====================== LIGHTBOX ====================== */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(34,22,55,0.92);
  display: flex; align-items: center; justify-content: center; padding: 2rem;
}
.lightbox[hidden] { display: none; }
.lb-content img, .lb-content video { max-width: 92vw; max-height: 86vh; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.lb-close {
  position: absolute; top: 1.2rem; right: 1.4rem; width: 48px; height: 48px; border-radius: 50%;
  border: none; background: #fff; color: var(--c-ink); font-size: 1.3rem; cursor: pointer; font-weight: 800; z-index: 2;
}
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,0.9); color: var(--c-ink); font-size: 2rem; font-weight: 800;
  display: grid; place-items: center; line-height: 1; transition: transform .15s, background .15s;
}
.lb-nav:hover { background: #fff; transform: translateY(-50%) scale(1.08); }
.lb-prev { left: 1.2rem; }
.lb-next { right: 1.2rem; }
.lb-counter {
  position: absolute; bottom: 1.4rem; left: 50%; transform: translateX(-50%); z-index: 2;
  background: rgba(255,255,255,0.92); color: var(--c-ink); padding: 0.35rem 1rem;
  border-radius: 999px; font-weight: 800; font-size: 0.95rem;
}

/* ====================== PDF compacto + modal ====================== */
.pdf-mini {
  position: relative; display: flex; align-items: center; gap: 0.9rem; cursor: pointer;
  border: 2px solid #efe6f8; border-radius: 16px; background: #faf6ff; padding: 0.8rem 1rem;
  transition: transform .15s, box-shadow .15s;
}
.pdf-mini:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(123,90,175,0.18); border-color: var(--c-purple); }
.pdf-ico { font-size: 1.8rem; flex: 0 0 auto; }
.pdf-meta { display: flex; flex-direction: column; min-width: 0; }
.pdf-title { font-weight: 800; color: var(--c-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdf-action { font-size: 0.82rem; font-weight: 700; color: var(--c-purple); }

.pdf-modal-card {
  position: relative; background: #fff; border-radius: 20px; overflow: hidden;
  width: min(900px, 96vw); height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 70px rgba(0,0,0,0.45);
}
.pdf-modal-head { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 1rem; background: #f1e7fb; }
.pdf-modal-title { font-weight: 800; color: var(--c-ink); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdf-modal-open { font-size: 0.82rem; padding: 0.4rem 0.9rem; }
.pdf-modal-head .modal-close { position: static; flex: 0 0 auto; }
#pdfModalFrame { flex: 1; width: 100%; border: none; background: #fff; }

/* ====================== EVIDENCIA ====================== */
.evidencia { padding: 2rem 1.2rem 1rem; }
.evidencia-inner { max-width: 880px; margin: 0 auto; }
.evidencia-head { text-align: center; margin-bottom: 1.4rem; }
.evidencia-badge {
  display: inline-block; background: var(--c-coral); color: #fff; font-weight: 800;
  padding: 0.4rem 1.2rem; border-radius: 999px; letter-spacing: .5px; margin-bottom: 0.6rem;
  box-shadow: 0 6px 18px rgba(255,140,97,0.45);
}
.evidencia-head h2 { font-size: 2rem; color: var(--c-purple); }
.evidencia-head p { color: var(--c-soft); font-weight: 600; }
.evidencia-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.4rem 1.5rem; border-top: 8px solid var(--c-coral);
}

/* ====================== FOOTER ====================== */
.footer { text-align: center; padding: 2.5rem 1.5rem; color: var(--c-soft); }
.footer p { font-weight: 700; }
.footer-small { font-weight: 600; font-size: 0.85rem; opacity: 0.75; margin-top: 0.4rem; }

/* ====================== TOAST ====================== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120px);
  background: var(--c-ink); color: #fff; padding: 0.8rem 1.5rem; border-radius: 999px;
  font-weight: 700; z-index: 200; box-shadow: 0 10px 30px rgba(0,0,0,0.3); transition: transform .35s;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ====================== ROLES (visibilidad) ====================== */
[data-admin-only], [data-viewer-only] { display: none !important; }
body.role-admin  [data-admin-only]  { display: inline-flex !important; }
body.role-viewer [data-viewer-only] { display: inline-flex !important; }

body.role-viewer .btn-upload,
body.role-viewer .btn-save,
body.role-viewer .del { display: none !important; }
body.role-viewer .module-head { justify-content: flex-start; }

/* Mientras carga el rol, ocultar el cuerpo para evitar parpadeos */
body.role-loading .navbar,
body.role-loading .cover,
body.role-loading .intro,
body.role-loading .timeline,
body.role-loading .footer { visibility: hidden; }

.nav-auth { display: flex; align-items: center; gap: 0.5rem; }
.role-pill { padding: 0.35rem 0.9rem; border-radius: 999px; font-weight: 800; font-size: 0.85rem; }
.role-pill-admin  { background: #fff0c2; color: #8a6a00; }
.role-pill-viewer { background: #d9f6ff; color: #06647e; }
.btn-share { background: var(--c-blue); color: #053a4a; box-shadow: 0 5px 14px rgba(76,201,240,0.4); }
.btn-ghost { background: #f1ecf8; color: var(--c-soft); }
.btn-ghost:hover { background: #e6def3; }

/* ====================== GATE / LOGIN ====================== */
.gate {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  background: linear-gradient(160deg, #ffd6e8 0%, #d8c2ff 45%, #bfe9ff 100%);
}
.gate[hidden] { display: none; }
.gate-card {
  background: #fff; border-radius: 28px; padding: 2.4rem 2rem; max-width: 420px; width: 100%;
  text-align: center; box-shadow: 0 24px 70px rgba(90,61,122,0.35);
}
.gate-logo { font-size: 3.4rem; }
.gate-card h1 { font-size: 1.7rem; color: var(--c-purple); margin-top: 0.4rem; }
.gate-sub { color: var(--c-soft); margin: 0.5rem 0 1.4rem; font-weight: 600; }
.gate-form { display: flex; flex-direction: column; gap: 0.9rem; text-align: left; }
.gate-form label { font-weight: 800; color: var(--c-ink); display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; }
.gate-form input {
  border: 2px solid #ead9f7; border-radius: 14px; padding: 0.75rem 1rem;
  font-family: 'Nunito'; font-size: 1rem; color: var(--c-ink);
}
.gate-form input:focus { outline: none; border-color: var(--c-purple); box-shadow: 0 0 0 4px rgba(155,93,229,0.15); }
.gate-btn { margin-top: 0.4rem; font-size: 1.05rem; padding: 0.8rem; justify-content: center; }
.gate-error { background: #ffe0e6; color: #b00034; padding: 0.6rem 0.9rem; border-radius: 12px; font-weight: 700; font-size: 0.9rem; }
.gate-error[hidden] { display: none; }
.gate-note { margin-top: 1.3rem; font-size: 0.85rem; color: var(--c-soft); }
.gate-denied { background: linear-gradient(160deg,#ffd6d6,#e0c2ff); }

/* ====================== MODAL COMPARTIR ====================== */
.modal {
  position: fixed; inset: 0; z-index: 250; background: rgba(34,22,55,0.78);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.modal[hidden] { display: none; }
.modal-card {
  position: relative; background: #fff; border-radius: 26px; padding: 2rem 1.8rem;
  max-width: 460px; width: 100%; box-shadow: 0 24px 70px rgba(0,0,0,0.4);
  max-height: 92vh; overflow-y: auto;
}
.modal-close { position: absolute; top: 1rem; right: 1.1rem; width: 38px; height: 38px; border-radius: 50%;
  border: none; background: #f1ecf8; color: var(--c-ink); font-size: 1.1rem; cursor: pointer; font-weight: 800; }
.modal-card h2 { color: var(--c-purple); font-size: 1.5rem; }
.modal-desc { color: var(--c-soft); margin: 0.4rem 0 1.2rem; font-size: 0.95rem; }
.share-field { display: block; font-weight: 800; color: var(--c-ink); font-size: 0.9rem; }
.share-row { display: flex; gap: 0.5rem; margin-top: 0.4rem; }
.share-row input {
  flex: 1; min-width: 0; border: 2px solid #ead9f7; border-radius: 12px; padding: 0.65rem 0.8rem;
  font-family: 'Nunito'; font-size: 0.85rem; color: var(--c-ink); background: #faf6ff;
}
.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.8rem; margin: 1.4rem 0; }
.qr-wrap img { width: 220px; height: 220px; border-radius: 16px; border: 4px solid #f1e7fb; }
.modal-danger { border-top: 2px dashed #f0e6f7; padding-top: 1rem; text-align: center; }
.modal-danger p { color: var(--c-soft); font-size: 0.9rem; margin-bottom: 0.6rem; }

/* ====================== RESPONSIVE ====================== */
@media (max-width: 820px) {
  .nav-links { position: absolute; top: 100%; right: 0; left: 0; flex-direction: column;
    background: #fff; padding: 0.6rem; box-shadow: 0 10px 24px rgba(0,0,0,0.12);
    max-height: 0; overflow: hidden; transition: max-height .3s; }
  .nav-links.open { max-height: 380px; padding: 0.8rem; }
  .nav-toggle { display: block; }

  .tl-decor .decor { opacity: 0.28; width: 56px !important; }
  .tl-decor .d1, .tl-decor .d3, .tl-decor .d5 { left: -4%; }
  .tl-decor .d2, .tl-decor .d4, .tl-decor .d6 { right: -4%; }
  .cover-profile-info { text-align: center; }
  .cover-creds li { font-size: 0.85rem; }

  .timeline::before { left: 26px; }
  .tl-item, .tl-item.left, .tl-item.right { width: 100%; left: 0; padding: 1rem 0 1rem 3.6rem; }
  .tl-item .tl-dot, .tl-item.left .tl-dot, .tl-item.right .tl-dot { left: 2px; right: auto; }
  .lb-nav { width: 44px; height: 44px; font-size: 1.6rem; }
  .lb-prev { left: 0.4rem; } .lb-next { right: 0.4rem; }
  .pdf-modal-card { height: 86vh; }
}
