/* ============================================================
   Autoevaluación CEINAR · estilos compartidos
   Cuando lleguen los logos, ajusta solo estas variables.
   ============================================================ */
:root {
  --brand: #1F6B4F;        /* verde CEINAR */
  --brand-deep: #0A3B2B;
  --brand-tint: #E6F4EA;
  --bg: #FBF6EA;
  --paper: #FFFFFF;
  --ink: #1D2E26;
  --ink-soft: #4A5F55;
  --rule: #E5D8BC;
  --mark: #F5B042;        /* dorado: nota mínima y acentos */
  --accent: #B4532B;      /* terracota: consulta de notas */
  --gold: #FFD966;
  --ok: #1E6B3A;  --ok-bg: #E6F4EA;
  --warn: #7A4E00; --warn-bg: #FFF0C7;
  --bad: #B42B3A; --bad-bg: #FCE8E6;
  --info-bg: #FFFBF0;

  --f-display: 'Bricolage Grotesque', 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
  --f-body: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, -apple-system, Verdana, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}
h1, h2, h3 { font-family: var(--f-display); line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- encabezado con papel cuadriculado ---------- */
.cabecera {
  background: linear-gradient(145deg, var(--brand-deep), var(--brand));
  border-bottom: 6px solid var(--mark);
  color: #fff;
  padding: 26px max(16px, env(safe-area-inset-right)) 54px max(16px, env(safe-area-inset-left));
}
.envoltura { width: 100%; max-width: 700px; margin: 0 auto; }
.marcas { display: flex; gap: 10px; margin-bottom: 22px; }
.marcas:empty { display: none; }
.logo-chip {
  width: 58px; height: 58px; background: #fff; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; padding: 6px;
}
.logo-chip img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cabecera h1 { font-size: clamp(38px, 9vw, 60px); font-weight: 800; color: var(--gold); }
.cabecera .quien { margin-top: 10px; font-size: 18px; color: #D4EDC9; }
.cabecera .lema { margin-top: 12px; font-size: 15px; font-style: italic; color: #F9E0A0; }
.cabecera { text-align: center; }
.cabecera .quien, .cabecera .lema { text-align: center; }
.cabecera .quien strong { color: #fff; font-weight: 700; }

/* ---------- pasos ---------- */
.pasos { list-style: none; display: flex; gap: 8px; padding: 0; margin: -26px 0 22px; }
.pasos li {
  flex: 1; background: var(--paper); border: 1px solid var(--rule); border-radius: 60px;
  padding: 9px 14px; display: flex; align-items: center; gap: 9px;
  font-size: 14.5px; color: var(--ink-soft); line-height: 1.2;
}
.pasos .n {
  flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--rule);
  display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; font-size: 13px;
}
.pasos li.actual { color: var(--ink); border-color: var(--brand); font-weight: 700; }
.pasos li.actual .n { background: var(--brand); border-color: var(--brand); color: #fff; }
.pasos li.hecho .n { background: var(--brand-tint); border-color: var(--brand-tint); color: var(--brand); }
@media (max-width: 520px) { .pasos li { padding: 8px 8px; font-size: 13px; gap: 6px; } .pasos .n { width: 22px; height: 22px; } }

/* ---------- paneles ---------- */
main { padding: 0 max(16px, env(safe-area-inset-right)) 56px max(16px, env(safe-area-inset-left)); }
.panel { background: var(--paper); border: 1px solid var(--rule); border-radius: 24px; padding: 28px 24px; box-shadow: 0 14px 30px -14px rgba(0,0,0,.25); }
.panel h2 { font-size: 28px; font-weight: 800; }
.panel .lead { margin-top: 10px; color: var(--ink-soft); max-width: 60ch; }
.pie { margin-top: 20px; font-size: 14.5px; color: var(--ink-soft); max-width: 62ch; }

/* ---------- formulario ---------- */
label.campo { display: block; margin-top: 24px; font-weight: 700; }
.ayuda { font-weight: 400; color: var(--ink-soft); font-size: 15px; margin-top: 2px; }
input[type="text"], input[type="tel"], select {
  width: 100%; margin-top: 8px; font: inherit; font-size: 22px; letter-spacing: .04em;
  padding: 13px 18px; border: 2px solid var(--rule); border-radius: 60px; background: #fff; color: var(--ink);
}
select { font-size: 17px; letter-spacing: 0; }
input:focus, select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 4px var(--brand-tint); }
.error {
  margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--bad-bg);
  color: var(--bad); border-left: 5px solid var(--bad); font-weight: 700;
}

/* ---------- botones ---------- */
.boton {
  font: inherit; font-weight: 700; font-size: 18px; cursor: pointer; border: 2px solid var(--brand);
  background: var(--brand); color: #fff; padding: 13px 24px; border-radius: 60px;
  transition: background .15s, border-color .15s;
}
.boton:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.boton:disabled { opacity: .55; cursor: wait; }
.boton.lleno { width: 100%; margin-top: 22px; }
.boton.suave { background: transparent; color: var(--brand); }
.boton.suave:hover { background: var(--brand-tint); border-color: var(--brand); }
.enlace {
  font: inherit; background: none; border: 0; padding: 4px 0; color: var(--brand); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; font-weight: 700;
}
.barra { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.hola { font-size: 15.5px; color: var(--ink-soft); }
.hola strong { color: var(--ink); }

/* ---------- asignaturas ---------- */
.lista-materias { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; }
.materia {
  width: 100%; display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 16px;
  text-align: left; font: inherit; color: var(--ink); background: #fff; cursor: pointer;
  border: 2px solid var(--rule); border-radius: 20px; padding: 14px 18px 14px 14px;
  transition: border-color .15s, background .15s;
}
.materia:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-tint); }
.materia:disabled { cursor: not-allowed; opacity: .6; background: transparent; border-style: dashed; }
.materia .glifo { width: 56px; height: 56px; color: var(--brand); }
.materia:disabled .glifo { color: var(--ink-soft); }
.materia .nombre { font-family: var(--f-display); font-weight: 800; font-size: 24px; line-height: 1.1; }
.materia .nota-corta { display: block; font-family: var(--f-body); font-weight: 400; font-size: 15px; color: var(--ink-soft); margin-top: 3px; }
.materia .ir { font-weight: 700; color: var(--brand); }
.materia:disabled .ir { color: var(--ink-soft); font-weight: 400; }
.docente-nota { margin-top: 16px; padding: 12px 14px; background: var(--info-bg); border-radius: 10px; font-size: 15.5px; }

/* ---------- regla de notas (elemento central) ---------- */
.nota-grande { display: flex; align-items: baseline; gap: 10px; margin-top: 22px; }
.nota-grande .valor { font-family: var(--f-display); font-weight: 800; font-size: clamp(56px, 16vw, 84px); line-height: .95; }
.nota-grande .de { font-size: 18px; color: var(--ink-soft); }
.regla { margin-top: 18px; }
.regla .pista { position: relative; height: 20px; background: var(--brand-tint); border-radius: 10px; margin-top: 38px; }
.regla .relleno { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--brand); border-radius: 10px; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.regla.ok .relleno { background: var(--ok); }
.regla .minimo { position: absolute; top: -9px; bottom: -9px; width: 4px; margin-left: -2px; background: var(--mark); border-radius: 2px; box-shadow: 0 0 0 2px #fff; }
.regla .minimo span {
  position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-size: 14px; font-weight: 700; color: var(--ink);
}
.regla .marcas-regla { position: relative; height: 20px; margin-top: 7px; font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.regla .marcas-regla span { position: absolute; top: 0; transform: translateX(-50%); }
@media (prefers-reduced-motion: reduce) { .regla .relleno { transition: none; } }

/* ---------- intentos ---------- */
.intentos { display: flex; align-items: center; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.ficha {
  width: 40px; height: 40px; border-radius: 50%; border: 2px dashed var(--rule); color: var(--ink-soft);
  display: grid; place-items: center; font-family: var(--f-display); font-weight: 700;
}
.ficha.usada { background: var(--brand); border: 2px solid var(--brand); color: #fff; }
.intentos .texto { font-size: 16px; color: var(--ink-soft); margin-left: 4px; }
.intentos .texto strong { color: var(--ink); }

/* ---------- mensaje de estado ---------- */
.aviso { margin-top: 24px; padding: 16px 18px; border-radius: 16px; border-left: 6px solid var(--brand); background: var(--info-bg); }
.aviso h3 { font-size: 22px; font-weight: 800; }
.aviso p { margin-top: 6px; }
.aviso.ok { background: var(--ok-bg); border-color: var(--ok); }
.aviso.ok h3 { color: var(--ok); }
.aviso.alerta { background: var(--warn-bg); border-color: var(--mark); }
.aviso.alerta h3 { color: var(--warn); }
.aviso.neutro { background: #F1EFE8; border-color: var(--ink-soft); }
.acciones { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 22px; }
.acciones .boton.lleno { margin-top: 0; width: auto; flex: 1 1 260px; }
.cargando { margin-top: 24px; color: var(--ink-soft); }

/* ---------- título centrado entre los dos logos ---------- */
.fila-titulo { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.cabecera .fila-titulo h1 { flex: 1; text-align: center; margin: 0; font-size: clamp(26px, 6.4vw, 50px); line-height: 1.1; }
@media (max-width: 520px) { .fila-titulo { gap: 8px; } .logo-chip { width: 46px; height: 46px; padding: 4px; } }

/* ---------- ¿qué quieres hacer? ---------- */
.opciones-ingreso { border: 0; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.opciones-ingreso legend { font-weight: 700; padding: 0; margin-bottom: 8px; }
.opcion-ingreso {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; cursor: pointer;
  border: 2px solid var(--rule); border-radius: 20px; padding: 14px 18px; background: #fff;
  transition: border-color .15s, background .15s;
}
.opcion-ingreso input { grid-row: 1 / 3; width: 22px; height: 22px; margin: 0; accent-color: var(--brand); }
.opcion-ingreso .t { font-family: var(--f-display); font-weight: 800; font-size: 20px; line-height: 1.1; }
.opcion-ingreso .d { font-size: 15px; color: var(--ink-soft); }
.opcion-ingreso:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.opcion-ingreso.notas:has(input:checked) { border-color: var(--accent); background: #FCF8EE; }
.opcion-ingreso.notas input { accent-color: var(--accent); }
.boton.notas { background: var(--accent); border-color: var(--accent); }
.boton.notas:hover { background: #8F3F1F; border-color: #8F3F1F; }

/* ---------- reporte de calificaciones ---------- */
.reporte { margin-top: 18px; background: var(--info-bg); border-left: 6px solid var(--brand); border-radius: 18px; padding: 20px 22px; box-shadow: 0 4px 12px rgba(0,0,0,.04); }
.reporte .fila { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed var(--rule); flex-wrap: wrap; }
.reporte .fila:last-of-type { border-bottom: 0; }
.reporte .etq { color: var(--ink-soft); min-width: 150px; font-weight: 700; }
.reporte .val { font-family: var(--f-display); font-weight: 800; font-size: 22px; }
.reporte .val.chica { font-family: var(--f-body); font-size: 17px; font-weight: 700; }
.comentario { margin-top: 14px; padding: 14px 16px; border-radius: 14px; border-left: 6px solid; }
.comentario p + p { margin-top: 8px; }
.comentario.ok { background: #E6F4EA; border-color: #34A853; color: #1E4620; }
.comentario.aviso1 { background: #FFF4E5; border-color: #F4B400; color: #3D2B00; }
.comentario.mal { background: #FCE8E6; border-color: #EA4335; color: #3C0A00; }
.estado-notas { margin-top: 14px; }
.cabecera .fila-titulo h1 { color: var(--gold); }
