/* T2 — estilos unificados · Programación 4° Medio */

/* Navegación superior */
.course-top {
  background: #0D2240;
  padding: .5rem 1rem;
  text-align: center;
  border-bottom: 3px solid #7B303E;
}
.course-top a {
  color: rgba(255, 255, 255, .88);
  text-decoration: none;
  font-size: .84rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.course-top a:hover { color: #D2AF57; }

/* Base */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --g: #059669; --gl: #ECFDF5;
  --b: #2563EB; --bl: #EFF6FF;
  --a: #D97706; --al: #FFFBEB;
  --r: #DC2626; --rl: #FEF2F2;
  --bg: #F1F5F9; --card: #FFF;
  --txt: #0F172A; --muted: #64748B; --bd: #E2E8F0;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--txt);
  line-height: 1.7;
}

/* Temas (colores primarios) */
.theme-figma {
  --p: #6366F1; --pd: #4F46E5; --ps: #7C3AED;
  --sl-arrow: #A5B4FC;
  --rbtn-shadow: rgba(79, 70, 229, .4);
  --rbtn-shadow-h: rgba(79, 70, 229, .5);
  --cls-div-my: 2.5rem 0 1.5rem;
}
.theme-app,
.theme-tink,
.theme-nota {
  --p: #0891B2; --pd: #0369A1; --ps: #0D9488;
  --sl-arrow: #67E8F9;
  --rbtn-shadow: rgba(3, 105, 161, .35);
  --rbtn-shadow-h: rgba(3, 105, 161, .45);
  --cls-div-my: 2rem 0 1.25rem;
}

/* Encabezado de página */
.hdr {
  color: #fff;
  padding: 3rem 1.5rem 3.5rem;
  text-align: center;
}
.theme-figma .hdr {
  background: linear-gradient(135deg, #4F46E5 0%, #6D28D9 55%, #9333EA 100%);
}
.theme-app .hdr,
.hdr-app {
  background: linear-gradient(135deg, #0369A1 0%, #0891B2 55%, #06B6D4 100%);
}
.theme-tink .hdr,
.hdr-tink {
  background: linear-gradient(135deg, #0F766E 0%, #059669 55%, #16A34A 100%);
}
.theme-nota .hdr,
.hdr-nota {
  background: linear-gradient(135deg, #374151 0%, #1F2937 60%, #111827 100%);
}

.hbadge {
  display: inline-block;
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 50px;
  padding: .35rem 1.1rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  margin-bottom: 1.2rem;
}
.nota-pill {
  display: inline-block;
  background: rgba(255, 255, 255, .25);
  border: 2px solid rgba(255, 255, 255, .5);
  border-radius: 50px;
  padding: .3rem 1.2rem;
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: .9rem;
}
.hdr h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: .75rem;
}
.hdr p {
  font-size: 1rem;
  opacity: .85;
  max-width: 580px;
  margin: 0 auto 1.5rem;
}
.hmeta {
  display: flex;
  justify-content: center;
  gap: .85rem;
  flex-wrap: wrap;
}
.hmeta span {
  font-size: .8rem;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 20px;
  padding: .28rem .85rem;
}

/* Contenido */
.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}
.obj {
  background: var(--card);
  border-radius: 16px;
  padding: 1.75rem;
  border-left: 5px solid var(--p);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .07);
  margin-bottom: 2rem;
}
.theme-figma .obj h2 {
  font-size: .93rem;
  font-weight: 700;
  color: var(--p);
  margin-bottom: 1rem;
}
.theme-app .obj h2,
.theme-tink .obj h2,
.theme-nota .obj h2 {
  font-size: .93rem;
  font-weight: 700;
  color: var(--pd);
  margin-bottom: 1rem;
}
.olist {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: .55rem;
}
.olist li {
  font-size: .87rem;
  color: var(--muted);
  padding-left: 1.3rem;
  position: relative;
}
.cls-div {
  text-align: center;
  margin: var(--cls-div-my);
  position: relative;
}
.cls-div::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--bd);
}
.cls-b {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--card);
  border: 2px solid var(--p);
  border-radius: 50px;
  padding: .45rem 1.4rem;
  font-weight: 700;
  font-size: .84rem;
}
.theme-figma .cls-b { color: var(--p); }
.theme-app .cls-b,
.theme-tink .cls-b,
.theme-nota .cls-b { color: var(--pd); }
.cls-b.warn { border-color: var(--r); color: var(--r); }
.cls-b.ok { border-color: var(--g); color: var(--g); }

.phase {
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .07);
  margin-bottom: 1.1rem;
}
.phh {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
}
.phh.g { background: var(--gl); }
.phh.b { background: var(--bl); }
.phh.a { background: var(--al); }
.phic {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
}
.phic.g { background: var(--g); }
.phic.b { background: var(--b); }
.phic.a { background: var(--a); }
.pht { font-size: .9rem; font-weight: 700; }
.pht.g { color: #064E3B; }
.pht.b { color: #1E3A8A; }
.pht.a { color: #78350F; }
.phd { font-size: .75rem; }
.phd.g { color: var(--g); }
.phd.b { color: var(--b); }
.phd.a { color: var(--a); }
.phbody { padding: 1.1rem 1.5rem; }
.phgoal {
  font-size: .81rem;
  color: var(--muted);
  font-style: italic;
  border-bottom: 1px solid var(--bd);
  padding-bottom: .75rem;
  margin-bottom: .9rem;
}
.ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.ul li {
  font-size: .87rem;
  color: var(--muted);
  padding-left: 1.1rem;
  position: relative;
}
.steps { display: flex; flex-direction: column; gap: 1rem; }
.step { display: flex; gap: .85rem; }
.sn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: .2rem;
}
.theme-figma .sn { background: var(--p); }
.theme-app .sn,
.theme-tink .sn,
.theme-nota .sn { background: var(--pd); }
.sc { flex: 1; }
.st {
  font-weight: 600;
  font-size: .88rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .3rem;
  flex-wrap: wrap;
}
.sm {
  background: #F1F5F9;
  border-radius: 20px;
  padding: .08rem .5rem;
  font-size: .7rem;
  color: var(--muted);
  font-weight: 500;
}
.sl {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .22rem;
}
.sl li {
  font-size: .83rem;
  color: var(--muted);
  padding-left: .85rem;
  position: relative;
}
.theme-figma .sl a { color: var(--p); }
.theme-app .sl a,
.theme-tink .sl a,
.theme-nota .sl a { color: var(--pd); }
.sl a { text-decoration: none; font-weight: 500; }
.sl a:hover { text-decoration: underline; }

/* Alertas */
.alert {
  border-radius: 12px;
  padding: .95rem 1.3rem;
  margin-top: 1.1rem;
  display: flex;
  gap: .85rem;
  align-items: flex-start;
}
.alert.red { background: var(--rl); border: 1px solid #FECACA; border-left: 4px solid var(--r); }
.alert.green { background: #F0FDF4; border: 1px solid #BBF7D0; border-left: 4px solid var(--g); }
.alert.blue { background: #EFF6FF; border: 1px solid #BFDBFE; border-left: 4px solid var(--b); }
.alert.teal { background: #F0FDFA; border: 1px solid #99F6E4; border-left: 4px solid #0D9488; }
.alert.cyan { background: #ECFEFF; border: 1px solid #A5F3FC; border-left: 4px solid #0891B2; }
.alico { font-size: 1.5rem; flex-shrink: 0; margin-top: .05rem; }
.alert h3 { font-size: .88rem; font-weight: 700; margin-bottom: .15rem; }
.alert.red h3 { color: var(--r); }
.alert.green h3 { color: var(--g); }
.alert.blue h3 { color: var(--b); }
.alert.teal h3 { color: #0D9488; }
.alert.cyan h3 { color: #0369A1; }
.alert p { font-size: .82rem; }
.alert.red p { color: #7F1D1D; }
.alert.green p { color: #14532D; }
.alert.blue p { color: #1E3A8A; }
.alert.teal p { color: #134E4A; }
.alert.cyan p { color: #0C4A6E; }

.classroom-steps,
.clist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-top: .5rem;
}
.classroom-steps li,
.clist li {
  font-size: .82rem;
  padding-left: 1.2rem;
  position: relative;
}
.classroom-steps li { color: #134E4A; }
.alert.teal .clist li { color: #134E4A; }
.alert.cyan .clist li { color: #0C4A6E; }
.alert.teal .alert.cyan /* Componentes TinkerCad */
.comp-box {
  background: #F0FDFA;
  border: 1px solid #99F6E4;
  border-radius: 12px;
  padding: 1rem 1.3rem;
  margin-top: 1.1rem;
}
.comp-box h3 {
  font-size: .88rem;
  font-weight: 700;
  color: #0F766E;
  margin-bottom: .6rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.comp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .4rem;
}
.comp-item {
  background: #fff;
  border: 1px solid #99F6E4;
  border-radius: 8px;
  padding: .5rem .75rem;
  font-size: .82rem;
  color: #134E4A;
  display: flex;
  align-items: center;
  gap: .4rem;
}

/* Pistas de bloques (TKC) */
.block-panel {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .07);
  padding: 1.5rem;
  margin-bottom: 1.1rem;
}
.block-panel > p:first-child { font-weight: 700; font-size: .93rem; color: #0369A1; margin-bottom: .25rem; }
.block-panel > p:nth-child(2) { font-size: .83rem; color: var(--muted); margin-bottom: 1rem; }
.pin-ref {
  background: #0F172A;
  border-radius: 8px;
  padding: .9rem 1.1rem;
  margin-top: 1rem;
}
.pin-ref-title {
  font-size: .72rem;
  font-weight: 700;
  color: #94A3B8;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: .5rem;
}
.pin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .4rem;
}
.pin-item {
  background: #1E293B;
  border-radius: 6px;
  padding: .3rem .6rem;
  font-size: .77rem;
  font-family: monospace;
}
.pin-item.g { color: #86EFAC; }
.pin-item.y { color: #FDE68A; }
.pin-item.r { color: #FCA5A5; }
.hint-box {
  background: #1E1B4B;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
}
.hint-box > p:first-child {
  font-size: .78rem;
  font-weight: 700;
  color: #C7D2FE;
  margin-bottom: .75rem;
}
.hint-note { color: #94A3B8; font-size: .72rem; margin-top: .4rem; }
.hint-sep {
  border-top: 1px solid rgba(255, 255, 255, .1);
  margin: .6rem 0 .35rem;
}
.hint-sep-label {
  color: #94A3B8;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.blk-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .28rem;
}
.blk-row.indent { margin-left: 1.25rem; }
.blk {
  border-radius: 5px;
  padding: .22rem .65rem;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  color: #fff;
}
.blk.orange { background: #F97316; }
.blk.purple { background: #7C3AED; }
.blk-hint { color: #94A3B8; font-size: .68rem; font-style: italic; }

/* Tabla de notas (Resumen) */
.nota-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}
.nota-tbl th {
  background: linear-gradient(135deg, #0369A1, #0D9488);
  color: #fff;
  padding: .9rem 1.1rem;
  text-align: left;
  font-size: .8rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.nota-tbl td {
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--bd);
}
.nota-tbl tr:last-child td {
  border-bottom: none;
  background: #F0FDFA;
  font-weight: 700;
}
.nota-tbl tr:nth-child(even) td { background: #F8FAFC; }
.nota-tbl tr:hover td { background: #ECFEFF; }
.pctbadge {
  display: inline-block;
  background: #0369A1;
  color: #fff;
  border-radius: 20px;
  padding: .18rem .65rem;
  font-size: .78rem;
  font-weight: 700;
}
.calc-box {
  background: #ECFEFF;
  border: 1px solid #A5F3FC;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.calc-box > p:first-child {
  font-size: .85rem;
  font-weight: 700;
  color: #0369A1;
  margin-bottom: .6rem;
}
.calc-grid {
  display: grid;
  gap: .4rem;
  font-size: .84rem;
  color: #0C4A6E;
}
.calc-row { display: flex; gap: .5rem; }
.calc-row span:first-child { min-width: 200px; }
.calc-total {
  border-top: 1px solid #A5F3FC;
  padding-top: .4rem;
  display: flex;
  gap: .5rem;
  font-weight: 700;
}
.calc-total strong { color: #0369A1; font-size: 1.05rem; }
.obj-nota { border-left-color: #374151; }
.obj-nota h2 { color: #1F2937; }

.theme-figma .nota-tbl th {
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
}
.theme-figma .nota-tbl tr:last-child td { background: #EDE9FE; }
.theme-figma .nota-tbl tr:hover td { background: #F5F3FF; }
.theme-figma .pctbadge { background: #4F46E5; }
.theme-figma .calc-box {
  background: #EDE9FE;
  border: 1px solid #C4B5FD;
}
.theme-figma .calc-box > p:first-child { color: #4F46E5; }
.theme-figma .calc-grid { color: #3730A3; }
.theme-figma .calc-total { border-top: 1px solid #C4B5FD; }
.theme-figma .calc-total strong { color: #4F46E5; font-size: 1.05rem; }
.theme-figma .obj-nota { border-left-color: #4F46E5; }
.theme-figma .obj-nota h2 { color: #4338CA; }
.mh-figma { background: linear-gradient(135deg, #4F46E5, #7C3AED); }

/* Navegación inferior */
.pnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 880px;
  margin: 0 auto;
  padding: 1.25rem;
}
.nbtn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  padding: .55rem 1.1rem;
  font-size: .84rem;
  font-weight: 600;
  transition: background .2s;
}
.theme-figma .nbtn { background: var(--p); }
.theme-figma .nbtn:hover { background: var(--pd); }
.theme-app .nbtn,
.theme-tink .nbtn,
.theme-nota .nbtn { background: var(--pd); }
.theme-app .nbtn:hover,
.theme-tink .nbtn:hover,
.theme-nota .nbtn:hover { background: var(--ps); }
.nbtn.ghost { visibility: hidden; }

/* Botón rúbrica flotante */
.rbtn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: linear-gradient(135deg, var(--pd), var(--ps));
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: .8rem 1.5rem;
  font-family: 'Inter', sans-serif;
  font-size: .87rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px var(--rbtn-shadow);
  display: flex;
  align-items: center;
  gap: .4rem;
  transition: all .25s;
  z-index: 100;
}
.rbtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px var(--rbtn-shadow-h);
}

/* Modal rúbrica */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(3px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all .3s;
}
.overlay.on { opacity: 1; visibility: visible; }
.modal {
  background: #fff;
  border-radius: 20px;
  max-width: 820px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(.97);
  transition: all .3s;
}
.overlay.on .modal { transform: none; }
.mh {
  color: #fff;
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 20px 20px 0 0;
  position: sticky;
  top: 0;
  z-index: 1;
}
.theme-figma .mh { background: linear-gradient(135deg, var(--pd), var(--ps)); }
.mh-app { background: linear-gradient(135deg, #0369A1, #0891B2); }
.mh-tink { background: linear-gradient(135deg, #0F766E, #059669); }
.mh h2 { font-size: 1.05rem; font-weight: 700; }
.mx {
  background: rgba(255, 255, 255, .2);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.mx:hover { background: rgba(255, 255, 255, .35); }
.mbody { padding: 1.5rem; }
.msub { font-size: .82rem; color: var(--muted); margin-bottom: 1.2rem; }

.rtbl {
  width: 100%;
  border-collapse: collapse;
  font-size: .79rem;
}
.rtbl th {
  background: #F8FAFC;
  padding: .7rem .85rem;
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: .71rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 2px solid var(--bd);
}
.rtbl td {
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--bd);
  vertical-align: top;
}
.rtbl tr:last-child td { border-bottom: none; }
.rtbl tr:hover td { background: #F8FAFC; }
.l0 { color: #9CA3AF; }
.l1 { color: #EF4444; }
.l2 { color: #F59E0B; }
.l3 { color: #10B981; }

.sbox {
  border-radius: 10px;
  padding: .85rem 1.1rem;
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .85rem;
}
.theme-figma .sbox {
  background: #F8FAFC;
  border: 1px solid var(--bd);
}
.theme-figma .sbox strong { color: var(--p); font-size: 1.05rem; }
.theme-app .sbox,
.theme-tink .sbox,
.theme-nota .sbox {
  background: #F0FDFA;
  border: 1px solid #99F6E4;
}
.theme-app .sbox strong,
.theme-tink .sbox strong,
.theme-nota .sbox strong { color: var(--pd); font-size: 1.05rem; }

footer {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: .79rem;
}

@media (max-width: 580px) {
  .rtbl { font-size: .72rem; }
  .rtbl th, .rtbl td { padding: .48rem .38rem; }
  .mbody { padding: .9rem; }
  .rbtn { padding: .7rem 1.1rem; font-size: .8rem; }
  .hmeta { gap: .5rem; }
  .comp-grid { grid-template-columns: repeat(2, 1fr); }
  .calc-row span:first-child { min-width: 140px; }
}

/* --- marcadores de lista --- */
.olist li::before,
.ul li::before,
.sl li::before,
.classroom-steps li::before,
.clist li::before {
  display: block;
  position: absolute;
  box-sizing: border-box;
}

.olist li::before {
  content: "";
  left: 0;
  top: 0.2em;
  width: 6px;
  height: 10px;
  border: solid var(--g);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.ul li::before {
  content: "";
  left: 0.15rem;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #64748B;
}

.sl li::before {
  content: ">";
  left: 0;
  top: 0;
  width: auto;
  height: auto;
  border: none;
  transform: none;
  background: none;
  color: var(--sl-arrow);
  font-weight: 700;
  font-size: 0.9em;
  line-height: 1.4;
}

.classroom-steps li::before {
  content: "";
  left: 0;
  top: 0.2em;
  width: 6px;
  height: 10px;
  border: solid #0D9488;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.clist li::before {
  content: "";
  left: 0;
  top: 0.2em;
  width: 6px;
  height: 10px;
  border: solid #0D9488;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.alert.teal .clist li::before { border-color: #0D9488; }
.alert.cyan .clist li::before { border-color: #0891B2; }
