/* Academia OTI · perfil, acceso y verificación */
.otia {
  --ink: #14142B; --mut: #5C5F6B; --line: #E4E2DC; --bg: #FFFFFF; --soft: #F6F5F1; --acc: #464DE6; --ok: #0A8A3A; --no: #B32D2E;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); line-height: 1.5;
  max-width: 1100px; margin: 0 auto; padding: 8px 0 32px; box-sizing: border-box;
}
.otia *, .otia *::before, .otia *::after { box-sizing: border-box; }
.otia h2, .otia h3, .otia h4 { font-family: "Space Grotesk", Inter, sans-serif; color: var(--ink); margin: 0; line-height: 1.15; }
.otia a { color: inherit; }
.otia code { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .92em; }
.otia-eyebrow { font-family: "Press Start 2P", "JetBrains Mono", monospace; font-size: 10px; letter-spacing: .04em; color: var(--acc); text-transform: uppercase; display: block; margin-bottom: 10px; }
.otia-badge { image-rendering: pixelated; flex: none; display: block; }
.otia-help { color: var(--mut); font-size: 14px; margin: 4px 0 14px; }
.otia-warn { background: #FFF6D6; border: 1px solid #F0D589; border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.otia-tag { display: inline-block; font-size: 12px; font-weight: 600; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; margin: 2px 2px 0 0; color: var(--ink); }
.otia-pill { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; background: var(--soft); color: var(--mut); }
.otia-pill.ok { background: #E3F4E8; color: var(--ok); }
.otia-pill.no { background: #FBE7E7; color: var(--no); }

.otia-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--ink); color: #fff !important; border: 2px solid var(--ink); border-radius: 10px; padding: 9px 16px; font: 600 14px/1.2 Inter, sans-serif; text-decoration: none; cursor: pointer; box-shadow: 3px 3px 0 var(--c, var(--acc)); transition: transform .12s, box-shadow .12s; }
.otia-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--c, var(--acc)); }
.otia-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--c, var(--acc)); }
.otia-btn.ghost { background: transparent; color: var(--ink) !important; }
.otia-btn.sm { padding: 6px 12px; font-size: 13px; box-shadow: 2px 2px 0 var(--c, var(--acc)); }
.otia-btn[disabled] { opacity: .65; cursor: progress; }

/* Encabezado */
.otia-hero { display: flex; gap: 20px; align-items: center; background: var(--ink); color: #fff; border-radius: 18px; padding: 24px 26px; position: relative; overflow: hidden; }
.otia-hero::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 12px 12px; pointer-events: none; }
.otia-hero h2 { color: #fff; font-size: clamp(22px, 3vw, 30px); }
.otia-hero .otia-eyebrow { color: #FFD23F; }
.otia-hero p { margin: 6px 0 0; color: #CFCFE6; font-size: 14px; }
.otia-hero .otia-tag { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); color: #fff; }
.otia-avatar { width: 76px; height: 76px; flex: none; border-radius: 16px; overflow: hidden; background: var(--acc); display: grid; place-items: center; box-shadow: 4px 4px 0 #FFD23F; z-index: 1; }
.otia-avatar img { width: 100%; height: 100%; object-fit: cover; }
.otia-avatar span { font: 700 28px "Space Grotesk", sans-serif; color: #fff; }
.otia-who { flex: 1; min-width: 0; z-index: 1; }
.otia-out { z-index: 1; color: #CFCFE6 !important; font-size: 13px; text-decoration: underline; align-self: flex-start; }

/* Resumen */
.otia-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.otia-stats div { background: var(--bg); border: 2px solid var(--ink); border-radius: 14px; padding: 14px 16px; box-shadow: 3px 3px 0 var(--line); }
.otia-stats b { display: block; font: 700 28px/1.1 "Space Grotesk", sans-serif; }
.otia-stats b small { font-size: 15px; color: var(--mut); }
.otia-stats span { font-size: 13px; color: var(--mut); }

.otia-next { display: flex; align-items: center; gap: 14px; text-decoration: none; background: var(--soft); border: 2px dashed var(--c); border-radius: 14px; padding: 12px 16px; margin-bottom: 8px; }
.otia-next span { flex: 1; font-size: 14px; }
.otia-next small { display: block; font-family: "Press Start 2P", monospace; font-size: 8px; color: var(--c); margin-bottom: 4px; text-transform: uppercase; }
.otia-next i { font-style: normal; font-size: 22px; color: var(--c); }

/* Secciones */
.otia-sec { margin-top: 28px; }
.otia-sec > h3 { font-size: 21px; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.otia-sec > h3::before { content: ""; width: 10px; height: 10px; background: var(--acc); box-shadow: 10px 0 0 #FFD23F; margin-right: 12px; }

/* Cursos */
.otia-courses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.otia-course { border: 2px solid var(--ink); border-radius: 16px; padding: 16px 18px; background: var(--bg); display: flex; flex-direction: column; gap: 12px; box-shadow: 4px 4px 0 var(--c); }
.otia-course.is-optional { box-shadow: 4px 4px 0 var(--line); }
.otia-course header { display: flex; gap: 12px; align-items: flex-start; }
.otia-course header div { flex: 1; min-width: 0; }
.otia-course h4 { font-size: 18px; }
.otia-course header p { margin: 4px 0 0; font-size: 13.5px; color: var(--mut); }
.otia-status { font-size: 12px; font-weight: 700; white-space: nowrap; color: var(--mut); }
.otia-course.is-done .otia-status { color: var(--ok); }
.otia-bar { height: 12px; border: 2px solid var(--ink); border-radius: 4px; background: var(--soft); overflow: hidden; }
.otia-bar i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--c) 0 10px, color-mix(in srgb, var(--c) 75%, #fff) 10px 12px); transition: width .4s; }
.otia-lessons summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.otia-lessons ol { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.otia-lessons li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; padding: 6px 8px; border-radius: 8px; background: var(--soft); }
.otia-lessons li.seen span:first-of-type { text-decoration: line-through; text-decoration-color: var(--c); color: var(--mut); }
.otia-lessons label { display: flex; gap: 8px; align-items: center; flex: 1; min-width: 180px; cursor: pointer; }
.otia-lessons input { accent-color: var(--c); width: 16px; height: 16px; }
.otia-lessons small { color: var(--mut); }
.otia-links { display: inline-flex; gap: 10px; }
.otia-links a { font-size: 13px; font-weight: 600; color: var(--c); text-decoration: none; }
.otia-course footer { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: auto; }
.otia-best { font-size: 12.5px; color: var(--mut); margin-left: auto; }

/* Insignias */
.otia-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.otia-badge-card { margin: 0; border: 2px solid var(--ink); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; background: var(--bg); }
.otia-badge-card.locked { border-style: dashed; border-color: #A7AAAD; opacity: .75; }
.otia-badge-card figcaption { display: flex; flex-direction: column; gap: 6px; align-items: center; font-size: 13px; color: var(--mut); }
.otia-badge-card b { color: var(--ink); font-size: 14px; }
.otia-dl { display: flex; gap: 6px; }
.otia-dl a { font: 600 11px "JetBrains Mono", monospace; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; text-decoration: none; }
.otia-copy { font: 600 12.5px Inter, sans-serif; background: none; border: 0; color: var(--acc); cursor: pointer; text-decoration: underline; padding: 2px; }
.otia-sigrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; padding: 10px 14px; border: 1px dashed var(--line); border-radius: 12px; font-size: 13.5px; }
.otia-sigprev img { image-rendering: pixelated; }

/* Tablas */
.otia-table { overflow-x: auto; border: 2px solid var(--ink); border-radius: 14px; }
.otia-table table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 0; }
.otia-table th { text-align: left; background: var(--soft); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--mut); }
.otia-table th, .otia-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.otia-table tr:last-child td { border-bottom: 0; }
.otia-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.otia-foot { margin-top: 26px; font-size: 13px; color: var(--mut); }

/* Acceso */
.otia-login { display: grid; place-items: center; min-height: 380px; }
.otia-login-card { max-width: 520px; text-align: center; border: 2px solid var(--ink); border-radius: 20px; padding: 32px 28px; box-shadow: 6px 6px 0 var(--acc); background: var(--bg); }
.otia-login-card h2 { font-size: 26px; margin-bottom: 8px; }
.otia-login-card p { color: var(--mut); }
.otia-login-badges { display: flex; justify-content: center; gap: 8px; margin-bottom: 18px; }
.otia-gbtn { display: flex; justify-content: center; margin: 18px 0 8px; min-height: 44px; }
.otia-login-msg { min-height: 20px; color: var(--no); font-size: 14px; }

/* Verificación */
.otia-verify { max-width: 760px; }
.otia-vhead h2 { font-size: 28px; margin-bottom: 6px; }
.otia-vhead p { color: var(--mut); margin: 0 0 16px; }
.otia-vform { display: flex; gap: 10px; flex-wrap: wrap; }
.otia-vform input { flex: 1; min-width: 200px; font: 600 18px "JetBrains Mono", monospace; letter-spacing: .06em; text-transform: uppercase; padding: 12px 14px; border: 2px solid var(--ink); border-radius: 10px; }
.otia-vres { display: flex; gap: 18px; align-items: flex-start; margin-top: 20px; border: 2px solid var(--ink); border-radius: 16px; padding: 20px; box-shadow: 5px 5px 0 var(--ok); background: var(--bg); }
.otia-vres.no { box-shadow: 5px 5px 0 var(--no); display: block; }
.otia-vres h3 { font-size: 24px; margin: 8px 0 4px; }
.otia-vres p { margin: 0 0 10px; }
.otia-vres dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 0; }
.otia-vres dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--mut); }
.otia-vres dd { margin: 0; font-weight: 600; }

@media (max-width: 760px) {
  .otia-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .otia-courses { grid-template-columns: 1fr; }
  .otia-hero { flex-wrap: wrap; padding: 20px; }
  .otia-vres { flex-direction: column; }
  .otia-best { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .otia-btn, .otia-bar i { transition: none; } }
.otia .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* ---------- Mis logros ---------- */
.otia-trophies { display: grid; gap: 14px; }
.otia-trophy { display: grid; grid-template-columns: 150px 1fr; gap: 20px; border: 2px solid var(--ink); border-radius: 18px; padding: 18px; background: var(--bg); box-shadow: 5px 5px 0 var(--c); }
.otia-trophy-art { align-self: start; display: flex; flex-direction: column; align-items: center; gap: 10px; background: #14142B; border-radius: 14px; padding: 14px 8px; background-image: linear-gradient(rgba(94,251,215,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(94,251,215,.08) 1px, transparent 1px); background-size: 12px 12px; }
.otia-trophy-art img { image-rendering: pixelated; width: 144px; height: 144px; filter: drop-shadow(4px 4px 0 rgba(0,0,0,.45)); }
.otia-trophy-art .otia-pill { font-size: 10.5px; white-space: nowrap; }
.otia-trophy-body h4 { font-size: 20px; }
.otia-trophy-meta { margin: 4px 0 12px; font-size: 13.5px; color: var(--mut); }
.otia-step { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; align-items: center; padding: 10px 0; border-top: 1px dashed var(--line); }
.otia-step > b { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.otia-step > b i { font: 9px/1 "Press Start 2P", monospace; font-style: normal; width: 22px; height: 22px; display: grid; place-items: center; background: var(--c); color: #fff; border-radius: 4px; }
.otia-step > span { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.otia-step > small, .otia-step > .otia-dl, .otia-step > .otia-sigprev { grid-column: 2; font-size: 12.5px; color: var(--mut); }
.otia .otia-btn.otia-copy { background: var(--ink); color: #fff; border: 2px solid var(--ink); text-decoration: none; font: 600 13px/1.2 Inter, sans-serif; padding: 6px 12px; }
.otia .otia-btn.otia-copy.ghost { background: transparent; color: var(--ink); }
.otia-li { background: #0A66C2 !important; border-color: #0A66C2 !important; color: #fff !important; }
.otia-sigprev img { image-rendering: pixelated; }
.otia-locked { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; font-size: 13px; color: var(--mut); }
.otia-locked a { opacity: .7; }

/* ---------- Aviso de logro ---------- */
.otia-modal { position: fixed; inset: 0; z-index: 99999; display: grid; place-items: center; padding: 16px; background: rgba(20,20,43,.72); animation: otiaIn .25s ease-out; }
.otia-modal.out { opacity: 0; transition: opacity .25s; }
.otia-modal-box { position: relative; max-width: 460px; width: 100%; text-align: center; background: #fff; border: 3px solid #14142B; border-radius: 22px; padding: 30px 24px 24px; box-shadow: 8px 8px 0 var(--c); overflow: hidden; font-family: Inter, system-ui, sans-serif; }
.otia-modal-box h2 { font: 700 24px/1.2 "Space Grotesk", sans-serif; margin: 8px 0; color: #14142B; }
.otia-modal-box p { color: #5C5F6B; margin: 0 0 18px; }
.otia-modal-badge { image-rendering: pixelated; margin: 6px auto 4px; display: block; animation: otiaPop .6s cubic-bezier(.2,1.6,.4,1) both .1s; filter: drop-shadow(5px 5px 0 rgba(20,20,43,.25)); }
.otia-modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.otia-modal-x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: #5C5F6B; }
.otia-confetti { position: absolute; inset: 0; pointer-events: none; }
.otia-confetti i { position: absolute; top: -12px; width: 8px; height: 8px; background: var(--c); animation: otiaFall 2.4s linear infinite; }
.otia-confetti i:nth-child(3n) { background: #FFD23F; } .otia-confetti i:nth-child(3n+1) { background: #5EFBD7; }
.otia-confetti i:nth-child(1){left:5%;animation-delay:0s}.otia-confetti i:nth-child(2){left:11%;animation-delay:.9s}.otia-confetti i:nth-child(3){left:17%;animation-delay:.3s}.otia-confetti i:nth-child(4){left:23%;animation-delay:1.5s}.otia-confetti i:nth-child(5){left:29%;animation-delay:.6s}.otia-confetti i:nth-child(6){left:35%;animation-delay:1.9s}.otia-confetti i:nth-child(7){left:41%;animation-delay:.2s}.otia-confetti i:nth-child(8){left:47%;animation-delay:1.1s}.otia-confetti i:nth-child(9){left:53%;animation-delay:.7s}.otia-confetti i:nth-child(10){left:59%;animation-delay:1.7s}.otia-confetti i:nth-child(11){left:65%;animation-delay:.4s}.otia-confetti i:nth-child(12){left:71%;animation-delay:1.3s}.otia-confetti i:nth-child(13){left:77%;animation-delay:.1s}.otia-confetti i:nth-child(14){left:83%;animation-delay:2s}.otia-confetti i:nth-child(15){left:89%;animation-delay:.8s}.otia-confetti i:nth-child(16){left:95%;animation-delay:1.4s}.otia-confetti i:nth-child(17){left:8%;animation-delay:2.2s}.otia-confetti i:nth-child(18){left:92%;animation-delay:.5s}
@keyframes otiaFall { to { transform: translateY(560px) rotate(270deg); } }
@keyframes otiaPop { from { transform: scale(.2) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes otiaIn { from { opacity: 0; } }
@media (max-width: 760px) {
  .otia-trophy { grid-template-columns: 1fr; }
  .otia-step { grid-template-columns: 1fr; }
  .otia-step > small, .otia-step > .otia-dl, .otia-step > .otia-sigprev { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) { .otia-confetti { display: none; } .otia-modal-badge, .otia-modal { animation: none; } }
.otia-vshare { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
