:root {
  color-scheme: light;
  font: 16px/1.55 system-ui, sans-serif;
  --paper: #f5f3eb;
  --surface: #fffefa;
  --ink: #183b49;
  --muted: #52645f;
  --sea: #173c4b;
  --line: #d9ded4;
  --sage: #e6ece3;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 5% 18%, #e7ece138, transparent 48%), var(--paper); }
a { color: #195d55; }
:focus-visible { outline: 3px solid #a95429; outline-offset: 4px; }
h1, h2, h3 { font-family: Georgia, serif; font-weight: 400; }
h1 { margin: 0 0 .9rem; font-size: clamp(2.3rem, 4.5vw, 4.15rem); line-height: 1.04; letter-spacing: -.035em; overflow-wrap: anywhere; }
h2 { margin: 0 0 .65rem; font-size: clamp(1.55rem, 2.3vw, 2rem); line-height: 1.15; }
p { margin: 0 0 1rem; }

.topbar, .wrap {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 3vw, 2.25rem);
}
.topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem 1.5rem; padding-block: 1.25rem; }
.wrap { padding-top: .5rem; padding-bottom: 3rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--ink); text-decoration: none; }
.brand svg { width: 44px; height: 44px; flex-shrink: 0; }
.brand strong, .brand small { display: block; }
.brand strong { font: 400 clamp(1.55rem, 2.7vw, 2rem)/1.1 Georgia, serif; }
.brand small { margin-top: .2rem; font-size: .77rem; letter-spacing: .07em; color: var(--muted); }
.cuenta-nav { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem 1rem; font-size: .9rem; }
.cuenta-nav form { margin: 0; }
.gestion-nav { display: flex; flex-wrap: wrap; gap: .35rem .75rem; }
.gestion-nav a { padding: .5rem .65rem; border-radius: .4rem; text-decoration: none; }
.gestion-nav a:hover { text-decoration: underline; }
.gestion-nav a[aria-current="page"] { background: var(--sage); font-weight: 650; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}
.hero-copy { align-self: center; min-width: 0; padding: clamp(1.4rem, 4.5vw, 3.5rem); }
.hero-copy > p { max-width: 38ch; margin-bottom: 0; color: var(--muted); }
.chart, .acceso-panel {
  display: grid;
  place-items: center;
  background-color: var(--sea);
  background-image: linear-gradient(#ffffff0d 1px, transparent 1px), linear-gradient(90deg, #ffffff0d 1px, transparent 1px);
  background-size: 36px 36px;
}
.chart { min-height: 15rem; padding: 1.25rem; }
.chart svg { width: min(100%, 11rem); }
.hero-gestion { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); margin-bottom: 1.25rem; }
.hero-gestion .hero-copy { padding-block: clamp(1.4rem, 3vw, 2.15rem); }
.hero-gestion .chart { min-height: 10rem; }
.hero-gestion .chart svg { width: min(100%, 6.5rem); }

.acceso { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.acceso-panel { padding: clamp(1.25rem, 4vw, 3rem); }
.panel { min-width: 0; margin-bottom: 1rem; padding: clamp(1rem, 2.6vw, 1.65rem); border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.panel.acceso-form { width: min(100%, 26rem); margin: 0; padding: clamp(1.05rem, 2.6vw, 1.75rem); }
.formulario { max-width: 29rem; display: grid; gap: .9rem; }
.formulario h2, .formulario p { margin: 0; }
.portal-alterno { margin-top: 1.1rem; font-size: .9rem; color: var(--muted); }
.marcas-curso { display: flex; flex-wrap: wrap; gap: .8rem 1.25rem; margin: 1.65rem 0 0; padding: 0; list-style: none; }
.marcas-curso li { display: grid; justify-items: center; gap: .35rem; font-size: .85rem; }

.sectionhead { margin: 1.7rem 0 1rem; }
.sectionhead h2 { margin: 0; }
.courses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(.85rem, 2.25vw, 1.4rem); }
.course { display: flex; flex-direction: column; min-width: 0; padding: clamp(1.05rem, 2.75vw, 1.75rem); border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.course-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--sage); }
.course-icon svg { width: 26px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.course h3 { margin: .9rem 0 .3rem; font-size: clamp(1.45rem, 2.5vw, 1.9rem); line-height: 1.12; }
.course-descripcion { flex: 1; margin-bottom: .8rem; color: var(--muted); }
.course-estado { margin-bottom: .25rem; font-weight: 650; }
.course-version { margin-bottom: .8rem; color: var(--muted); font-size: .82rem; }
.course-inactivo { background: #efeee7; }
.course-inactivo .course-icon { background: #e4e6df; }
.course .entrar-curso { width: 100%; justify-content: space-between; }
.course .entrar-curso:disabled { justify-content: center; border-color: #b0b9b0; background: #e5e8e1; color: #435653; cursor: default; }

.vigencia { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; }
.vigencia > label:not(.casilla) { flex: 1 1 12rem; min-width: 0; }
label { display: grid; gap: .25rem; font-weight: 600; }
input:not([type="checkbox"]):not([type="hidden"]) { width: 100%; min-width: 0; min-height: 2.75rem; padding: .45rem .65rem; border: 1px solid #9da9a2; border-radius: .4rem; background: #fff; color: inherit; font: inherit; }
.casilla { display: flex; min-height: 2.75rem; gap: .4rem; align-items: center; }
button, .boton { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.75rem; border: 1px solid var(--sea); border-radius: .55rem; padding: .5rem .95rem; background: var(--sea); color: #fffefa; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; }
button:not(:disabled):hover, .boton:hover { background: #235365; }
.secundario { border-color: #b4beb6; background: var(--surface); color: var(--sea); }
.secundario:hover:not(:disabled) { background: var(--sage); }
.acciones { display: flex; flex-wrap: wrap; gap: .65rem; margin-block: .9rem; }
fieldset { min-width: 0; margin: .7rem 0 0; padding: .75rem; border: 1px solid var(--line); border-radius: 9px; }
legend { padding: 0 .35rem; font-weight: 650; }
summary { cursor: pointer; overflow-wrap: anywhere; }
.estado-acceso { margin-block: 0 .55rem; font-weight: 600; }
.metricas-gestion {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: .75rem;
  margin: 0 0 .9rem;
}
.metricas-gestion > div { padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--sage); }
.metricas-gestion dt { font-weight: 600; }
.metricas-gestion dd { margin: .25rem 0 0; font: 400 2.25rem/1.1 Georgia, serif; }

.vencimientos p, .vencimientos ul { margin: 0; }
.vencimientos .ultimo-acceso { margin-bottom: .6rem; }
.vencimientos ul { padding: 0; list-style: none; }
.vencimientos li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .65fr) max-content;
  gap: .25rem 1rem;
  padding: .45rem 0;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.ultimo-acceso { margin-bottom: .65rem; color: var(--muted); font-size: .88rem; }
.horas-acceso { flex: 1 0 100%; padding-block: .25rem; }
.horas-acceso > .vigencia { margin-top: .65rem; }
[role="status"] { color: #195d55; }
[role="alert"] { color: #8f1a18; }

@media (max-width: 700px) {
  .hero, .acceso { grid-template-columns: 1fr; }
  .chart { min-height: 8rem; }
  .chart svg { width: 6.5rem; }
  .hero-gestion .chart { min-height: 6.5rem; }
  .hero-gestion .chart svg { width: 4.25rem; }
  .courses, .vencimientos li { grid-template-columns: 1fr; }
}
