/* Estandar de diseno — Departamento de Matematicas, Uniandes.
   Compartido por preplanta y horarioplanta. */

:root {
  --rojo:   #CD1945;
  --azul:   #06344D;
  --gris:   #f5f6f7;
  --borde:  #dde1e7;
  --texto:  #222;
  --muted:  #6b7280;
  --verde:  #1f6b54;
  --radio:  8px;
  --fuente: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--fuente);
  color: var(--texto);
  background: #fff;
  font-size: 15px;
  line-height: 1.6;
}

.contenedor { max-width: 860px; margin: 0 auto; padding: 24px 20px 40px; }

/* ---- Cabecera ---- */
.cabecera {
  background: var(--azul);
  border-radius: var(--radio);
  padding: 22px 26px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
}
.cab-titulo h1 { font-size: 1.25rem; font-weight: 700; color: #fff; }
.cab-titulo .sub {
  font-size: 12px; color: rgba(255,255,255,.6); margin-top: 4px;
  text-transform: uppercase; letter-spacing: 1px;
}
.cab-usuario { font-size: 13px; color: rgba(255,255,255,.85); text-align: right; }
.cab-usuario a { color: #fff; text-decoration: underline; }

/* ---- Bloque de descripcion ---- */
.descripcion {
  background: var(--gris);
  border-left: 3px solid var(--rojo);
  border-radius: 0 var(--radio) var(--radio) 0;
  padding: 14px 18px;
  font-size: 14px; color: #444;
  margin-bottom: 28px; line-height: 1.7;
}

/* ---- Preguntas ---- */
.pregunta {
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  margin-bottom: 16px;
  overflow: hidden;
}
.pregunta > h2 {
  font-size: 15px; font-weight: 600;
  background: var(--gris);
  padding: 12px 18px;
  border-bottom: 1px solid var(--borde);
  display: flex; gap: 10px; align-items: baseline;
}
.pregunta > h2 .num {
  color: var(--rojo); font-weight: 700; font-size: 13px;
  min-width: 18px;
}
.pregunta .cuerpo { padding: 16px 18px; }
.pregunta .ayuda { font-size: 13px; color: var(--muted); margin-bottom: 12px; }

/* ---- Controles ---- */
.opcion {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
}
.opcion:hover { background: var(--gris); }
.opcion input { margin-top: 4px; flex-shrink: 0; }

select, textarea {
  font-family: inherit; font-size: 14px; color: var(--texto);
  border: 1px solid var(--borde); border-radius: 6px;
  padding: 8px 10px; width: 100%; max-width: 420px; background: #fff;
}
textarea { max-width: 100%; resize: vertical; min-height: 76px; }
select:focus, textarea:focus, input:focus-visible {
  outline: 2px solid var(--rojo); outline-offset: 1px;
}
.campo { margin-bottom: 12px; }
.campo label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }

/* ---- Rejilla horaria ---- */
.rejilla-envoltura { overflow-x: auto; }
table.rejilla { border-collapse: collapse; width: 100%; min-width: 460px; }
table.rejilla th, table.rejilla td {
  border: 1px solid var(--borde); padding: 6px; text-align: center;
}
table.rejilla th {
  background: var(--gris); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
}
table.rejilla td.franja {
  text-align: left; font-size: 13px; white-space: nowrap;
  font-variant-numeric: tabular-nums; background: #fcfcfd;
}
table.rejilla td label {
  display: block; padding: 6px 0; cursor: pointer; border-radius: 4px;
}
table.rejilla td label:hover { background: var(--gris); }
table.rejilla input:checked + span { color: var(--rojo); font-weight: 700; }

.contador {
  font-size: 13px; color: var(--muted); margin-top: 10px;
}
.contador strong { color: var(--texto); }
.contador.excedido { color: var(--rojo); font-weight: 600; }

/* ---- Avisos ---- */
.aviso {
  border-radius: var(--radio); padding: 14px 18px; margin-bottom: 20px;
  font-size: 14px; line-height: 1.6;
}
.aviso.error { background: #fdf2f4; border: 1px solid var(--rojo); color: #7a0f28; }
.aviso.ok    { background: #eef6f2; border: 1px solid var(--verde); color: #14503f; }
.aviso.info  { background: var(--gris); border: 1px solid var(--borde); color: #444; }
.aviso h3 { font-size: 15px; margin-bottom: 6px; }
.aviso ul { margin: 6px 0 0 18px; }

/* ---- Botones ---- */
.acciones { display: flex; gap: 12px; align-items: center; margin-top: 24px; flex-wrap: wrap; }
.btn {
  background: var(--rojo); color: #fff; border: none;
  padding: 11px 26px; border-radius: 22px;
  font-family: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.btn:hover { background: #a81338; }
.btn:disabled { background: var(--muted); cursor: not-allowed; }
.btn-link {
  font-size: 13px; color: var(--rojo); text-decoration: none;
  border: 1px solid rgba(205,25,69,.3); padding: 6px 14px; border-radius: 20px;
  background: none; font-family: inherit; cursor: pointer;
}
.btn-link:hover { background: var(--rojo); color: #fff; }

.badge {
  font-size: 11px; padding: 2px 10px; border-radius: 12px;
  background: var(--gris); color: var(--muted); border: 1px solid var(--borde);
}

.pie { margin-top: 28px; font-size: 13px; color: var(--muted); }
.pie a { color: var(--rojo); }

@media (max-width: 600px) {
  .contenedor { padding: 16px 14px 32px; }
  .cabecera { flex-direction: column; gap: 12px; padding: 18px; }
  .cab-usuario { text-align: left; }
  .pregunta .cuerpo { padding: 14px; }
  select { max-width: 100%; }
}
