/* ladocencIA — estilos base. modern-ui.css se carga después como capa visual. */
:root {
  --verde-pizarron: #1B4332;
  --verde-pizarron-deep: #0F2A1F;
  --papel: #FBF6E8;
  --papel-borde: #E4D9BC;
  --tinta: #1F2A24;
  --gis-dorado: #D9A62E;
  --terracota: #A6533D;
  --gris-texto: #4B5A52;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Instrument Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); color: var(--tinta); background: var(--papel); line-height: 1.5; }

.hero { background: var(--verde-pizarron); color: var(--papel); padding: 4.5rem 1.5rem 5rem; }
.hero-inner { max-width: 640px; margin: 0 auto; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .5rem; }
.wordmark { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; color: var(--gis-dorado); margin: 0; }
.hero h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2.1rem,5vw,3.1rem); line-height: 1.15; margin: 0 0 1.25rem; max-width: 15ch; }
.hero-sub { font-size: 1.1rem; color: #DCE6DE; max-width: 46ch; margin: 0 0 2rem; }
.cta { display: inline-block; background: var(--gis-dorado); color: var(--verde-pizarron-deep); font-weight: 600; padding: .85rem 1.6rem; border-radius: 3px; text-decoration: none; }
.cta:hover { background: #E8B94A; }

.auth-box { font-size: .85rem; }
.auth-form { display: flex; gap: .5rem; }
.auth-form[hidden], .auth-in[hidden] { display: none; }
.auth-form input { padding: .45rem .6rem; border-radius: 3px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.08); color: var(--papel); font-size: .85rem; width: 180px; }
.auth-form input::placeholder { color: rgba(255,255,255,.5); }
.auth-in { display: flex; align-items: center; gap: .6rem; color: var(--papel); }
.btn-auth { background: var(--gis-dorado); color: var(--verde-pizarron-deep); border: 0; border-radius: 3px; padding: .45rem .75rem; font-weight: 600; font-size: .82rem; cursor: pointer; white-space: nowrap; }
.btn-auth-secundario { background: transparent; border: 1px solid rgba(255,255,255,.4); color: var(--papel); border-radius: 3px; padding: .4rem .65rem; font-size: .8rem; cursor: pointer; }
.auth-estado { min-height: 1rem; font-size: .8rem; color: var(--gis-dorado); margin: 0 0 1rem; }

.beneficios { max-width: 960px; margin: 0 auto; padding: 3rem 1.5rem; display: grid; grid-template-columns: repeat(3,1fr); }
.beneficio { padding: 0 1.75rem; border-left: 1px solid var(--papel-borde); }
.beneficio:first-child { border-left: 0; padding-left: 0; }
.beneficio h3 { font-family: var(--serif); font-weight: 500; font-size: 1.15rem; margin: 0 0 .5rem; }
.beneficio p { font-size: .94rem; color: var(--gris-texto); margin: 0; }

.mesa { max-width: 1080px; margin: 0 auto; padding: 1rem 1.5rem 5rem; display: grid; grid-template-columns: minmax(0,380px) 1fr; gap: 2rem; align-items: start; }
.panel h2 { font-family: var(--serif); font-weight: 500; font-size: 1.4rem; margin: 0 0 1.25rem; }
.panel-intake { background: #fff; border: 1px solid var(--papel-borde); border-radius: 4px; padding: 1.75rem; }
.panel-documento { background: var(--papel); border: 1px solid var(--papel-borde); border-radius: 4px; min-height: 480px; display: flex; flex-direction: column; }

.campo-libre span { display: block; font-size: .9rem; font-weight: 500; margin-bottom: .4rem; }
.campo-libre textarea { min-height: 6rem; }
.estado-ia { min-height: 1.1rem; font-size: .85rem; color: var(--gris-texto); margin: .4rem 0 .75rem; }
#generator-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--papel-borde); }
.fila { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label { display: flex; flex-direction: column; gap: .35rem; font-size: .88rem; font-weight: 500; }
input, select, textarea { font-family: var(--sans); padding: .6rem .7rem; border: 1px solid var(--papel-borde); border-radius: 3px; font-size: .95rem; background: var(--papel); color: var(--tinta); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--verde-pizarron); outline-offset: 1px; }
textarea { min-height: 4.5rem; resize: vertical; }

.btn-ghost { margin: .75rem 0 .25rem; background: transparent; border: 1px solid var(--verde-pizarron); color: var(--verde-pizarron); font: 600 .9rem var(--sans); padding: .55rem 1rem; border-radius: 3px; cursor: pointer; }
.btn-ghost:hover { background: rgba(27,67,50,.06); }
.btn-ghost:disabled, .btn-principal:disabled { opacity: .55; cursor: default; }
.btn-principal { background: var(--verde-pizarron); color: var(--papel); border: 0; font: 600 1rem var(--sans); padding: .85rem; border-radius: 3px; cursor: pointer; margin-top: .25rem; }
.btn-principal:hover { background: var(--verde-pizarron-deep); }

.documento-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; border-bottom: 1px solid var(--papel-borde); }
.documento-label { font-size: .8rem; font-weight: 600; color: var(--gris-texto); }
.documento-acciones button { background: none; border: 1px solid var(--papel-borde); color: var(--tinta); font: .82rem var(--sans); padding: .4rem .75rem; border-radius: 3px; cursor: pointer; margin-left: .5rem; }
.documento-acciones button:hover { border-color: var(--verde-pizarron); }
.documento-vacio { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2.5rem; text-align: center; }
.documento-vacio p { color: var(--gris-texto); max-width: 32ch; font-size: .95rem; }
.editable-hint { padding: .6rem 1.5rem; font-size: .8rem; color: var(--gris-texto); background: rgba(217,166,46,.1); border-bottom: 1px solid var(--papel-borde); margin: 0; }

.nivel-lectura-bar { display: flex; align-items: center; gap: .5rem; padding: .75rem 1.5rem; border-bottom: 1px solid var(--papel-borde); font-size: .85rem; flex-wrap: wrap; }
.btn-nivel { background: none; border: 1px solid var(--papel-borde); color: var(--tinta); font: .8rem var(--sans); padding: .35rem .7rem; border-radius: 3px; cursor: pointer; }
.btn-nivel.activo { background: var(--verde-pizarron); color: var(--papel); border-color: var(--verde-pizarron); }

.documento { padding: 2.5rem 3rem; font-family: var(--sans); }
.documento[contenteditable="true"] { outline: none; cursor: text; }
.documento[contenteditable="true"]:focus { box-shadow: inset 0 0 0 2px rgba(27,67,50,.15); }
.documento h1 { font-family: var(--serif); font-weight: 500; font-size: 1.7rem; margin: 0 0 1.5rem; padding-bottom: 1rem; border-bottom: 2px solid var(--gis-dorado); }
.documento h2 { font-family: var(--serif); font-weight: 500; font-size: 1.2rem; margin: 1.75rem 0 .6rem; color: var(--verde-pizarron); }
.documento h3 { font-size: 1rem; font-weight: 600; margin: 1.1rem 0 .4rem; }
.documento p, .documento li { font-size: .95rem; color: var(--tinta); }
.documento ul, .documento ol { padding-left: 1.3rem; }
.documento table { border-collapse: collapse; width: 100%; margin: .75rem 0; font-size: .88rem; }
.documento th, .documento td { border: 1px solid var(--papel-borde); padding: .5rem .65rem; text-align: left; }
.documento th { background: rgba(27,67,50,.06); }
.doc-header { margin-bottom: 2rem; font-size: .85rem; }
.doc-header td { border: 1px solid var(--papel-borde); padding: .5rem .7rem; }
.doc-header td:nth-child(1), .doc-header td:nth-child(3) { font-weight: 600; background: rgba(27,67,50,.04); width: 15%; }
.doc-imagen { display: block; max-width: 100%; border-radius: 4px; margin: 0 0 2rem; border: 1px solid var(--papel-borde); }
.doc-imagen-cargando { font-size: .85rem; color: var(--gris-texto); margin-bottom: 1.5rem; font-style: italic; }

.modal-fondo { position: fixed; inset: 0; background: rgba(15,42,31,.55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 1.5rem; }
.modal-caja { background: var(--papel); border-radius: 6px; max-width: 560px; width: 100%; max-height: 80vh; display: flex; flex-direction: column; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--papel-borde); }
.modal-header h3 { font-family: var(--serif); font-weight: 500; margin: 0; }
.btn-cerrar { background: none; border: 0; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--gris-texto); }
.lista-planeaciones { padding: .5rem 1.5rem 1.5rem; overflow-y: auto; }
.planeacion-item, .recurso-item { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .85rem 0; border-bottom: 1px solid var(--papel-borde); }
.planeacion-item-info, .recurso-item-info { font-size: .9rem; }
.planeacion-item-info small, .recurso-item-info small { display: block; color: var(--gris-texto); font-size: .78rem; margin-top: .15rem; }
.planeacion-item button { background: var(--verde-pizarron); color: var(--papel); border: 0; border-radius: 3px; padding: .4rem .75rem; font-size: .8rem; cursor: pointer; }
.recurso-item button { background: none; border: 1px solid var(--terracota); color: var(--terracota); border-radius: 3px; padding: .3rem .6rem; font-size: .78rem; cursor: pointer; white-space: nowrap; }
#admin-form { display: flex; flex-direction: column; gap: 1rem; margin: 1rem 0; }
#admin-form textarea { min-height: 6rem; }

.quiz-contenido { padding: 2rem 3rem; }
.quiz-titulo { font-family: var(--serif); font-size: 1.5rem; margin: 0 0 1.5rem; }
.quiz-pregunta { margin-bottom: 1.75rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--papel-borde); }
.quiz-pregunta p { font-weight: 600; margin: 0 0 .75rem; }
.quiz-opcion { display: block; width: 100%; text-align: left; padding: .6rem .9rem; margin-bottom: .5rem; border: 1px solid var(--papel-borde); border-radius: 3px; background: #fff; cursor: pointer; font: .92rem var(--sans); }
.quiz-opcion:hover { border-color: var(--verde-pizarron); }
.quiz-opcion.correcta { background: rgba(27,67,50,.12); border-color: var(--verde-pizarron); }
.quiz-opcion.incorrecta { background: rgba(166,83,61,.12); border-color: var(--terracota); }
.quiz-opcion:disabled { cursor: default; }
.quiz-explicacion { font-size: .85rem; color: var(--gris-texto); margin-top: .5rem; font-style: italic; }
.quiz-resumen { font-family: var(--serif); font-size: 1.2rem; padding: 1.5rem; background: rgba(27,67,50,.05); border-radius: 4px; text-align: center; }
.juego-frame { width: 100%; min-height: 560px; border: 0; flex: 1; }
.classroom-share { display: inline-block; vertical-align: middle; margin-left: .5rem; }

[hidden] { display: none !important; }

@media (max-width: 860px) { .mesa { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .beneficios { grid-template-columns: 1fr; gap: 1.75rem; }
  .beneficio { border-left: 0; padding-left: 0; border-top: 1px solid var(--papel-borde); padding-top: 1.5rem; }
  .beneficio:first-child { border-top: 0; padding-top: 0; }
  .fila { grid-template-columns: 1fr; }
}

@media print {
  body * { visibility: hidden; }
  #documento-contenido, #documento-contenido * { visibility: visible; }
  #documento-contenido { position: absolute; top: 0; left: 0; padding: 0; margin: 0; border: 0; box-shadow: none; }
}

