/* ladocencIA — modern UI layer
   Carga este archivo DESPUÉS de styles.css y nem-selector.css.
   No cambia la lógica de la aplicación; moderniza la presentación. */

:root {
  --ui-bg: #f4f7f3;
  --ui-surface: rgba(255,255,255,.94);
  --ui-surface-strong: #ffffff;
  --ui-border: rgba(22, 56, 42, .12);
  --ui-border-strong: rgba(22, 56, 42, .22);
  --ui-ink: #17231d;
  --ui-muted: #647168;
  --ui-green: #173f31;
  --ui-green-2: #245743;
  --ui-green-soft: #e8f1eb;
  --ui-gold: #d7a83d;
  --ui-gold-soft: #fff6dc;
  --ui-danger: #a14e3d;
  --ui-shadow-sm: 0 8px 24px rgba(18, 50, 37, .07);
  --ui-shadow: 0 20px 60px rgba(18, 50, 37, .10);
  --ui-radius-sm: 12px;
  --ui-radius: 20px;
  --ui-radius-lg: 28px;
  --ui-focus: 0 0 0 4px rgba(36, 87, 67, .12);
}

html { background: var(--ui-bg); }

body {
  color: var(--ui-ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(215,168,61,.12), transparent 22rem),
    radial-gradient(circle at 88% 25%, rgba(36,87,67,.08), transparent 28rem),
    var(--ui-bg);
  min-height: 100vh;
}

/* ---------- Hero / navigation ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 1.25rem 1.5rem 7rem;
  background:
    radial-gradient(circle at 75% 15%, rgba(215,168,61,.22), transparent 23rem),
    radial-gradient(circle at 15% 100%, rgba(255,255,255,.06), transparent 24rem),
    linear-gradient(135deg, #112b22 0%, #173f31 46%, #20523f 100%);
  border-radius: 0 0 38px 38px;
  box-shadow: 0 18px 50px rgba(14, 43, 32, .16);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1180px;
}

.hero-top {
  align-items: center;
  min-height: 54px;
  margin-bottom: 4.5rem;
}

.wordmark {
  position: relative;
  font-size: 1.35rem;
  letter-spacing: -.02em;
  color: #fff7d9;
}

.wordmark::after {
  content: "beta";
  display: inline-flex;
  margin-left: .55rem;
  padding: .18rem .45rem;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  color: rgba(255,255,255,.75);
  font-family: var(--sans);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  vertical-align: middle;
}

.auth-box {
  max-width: min(100%, 640px);
}

.auth-form,
.auth-in {
  padding: .42rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.auth-form input {
  min-height: 38px;
  width: min(230px, 42vw);
  border: 0;
  border-radius: 9px;
  background: rgba(255,255,255,.10);
}

.btn-auth,
.btn-auth-secundario {
  min-height: 38px;
  border-radius: 9px;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.btn-auth:hover,
.btn-auth-secundario:hover { transform: translateY(-1px); }

.hero h1 {
  max-width: 920px;
  margin-bottom: 1.35rem;
  font-size: clamp(2.65rem, 6vw, 5.4rem);
  line-height: .99;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.hero-sub {
  max-width: 680px;
  margin-bottom: 2rem;
  color: rgba(244,249,245,.82);
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.7;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  padding: .9rem 1.3rem;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(215,168,61,.18);
  transition: transform .16s ease, box-shadow .16s ease;
}

.cta::after { content: "→"; font-size: 1.1rem; }
.cta:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(215,168,61,.26); }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: 1.45rem;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .38rem .62rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.055);
  color: rgba(255,255,255,.76);
  font-size: .76rem;
  backdrop-filter: blur(8px);
}

/* ---------- Benefits ---------- */
.beneficios {
  position: relative;
  z-index: 4;
  max-width: 1180px;
  margin-top: -3.6rem;
  padding: 0 1.5rem 3.5rem;
  gap: 1rem;
}

.beneficio {
  position: relative;
  padding: 1.35rem 1.35rem 1.4rem;
  border: 1px solid var(--ui-border);
  border-radius: 18px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--ui-shadow-sm);
  backdrop-filter: blur(12px);
}

.beneficio,
.beneficio:first-child {
  border-left: 1px solid var(--ui-border);
  padding-left: 1.35rem;
}

.beneficio::before {
  content: "";
  display: block;
  width: 34px;
  height: 4px;
  margin-bottom: .95rem;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--ui-green-2), var(--ui-gold));
}

.beneficio h3 {
  margin-bottom: .45rem;
  font-size: 1.05rem;
  letter-spacing: -.015em;
}

.beneficio p { color: var(--ui-muted); line-height: 1.6; }

/* ---------- Workspace ---------- */
.mesa {
  max-width: 1320px;
  padding: .5rem 1.5rem 6rem;
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  gap: 1.6rem;
}

.panel {
  border-radius: var(--ui-radius-lg);
}

.panel-intake,
.panel-documento {
  border: 1px solid var(--ui-border);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow);
  backdrop-filter: blur(18px);
}

.panel-intake {
  position: sticky;
  top: 18px;
  padding: 1.45rem;
}

.panel h2 {
  margin-bottom: 1.2rem;
  font-size: 1.48rem;
  letter-spacing: -.025em;
}

.ui-step {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: .55rem;
  color: var(--ui-green-2);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ui-step::before {
  content: attr(data-step);
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--ui-green-soft);
  color: var(--ui-green);
  letter-spacing: 0;
}

#generator-form {
  gap: .9rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ui-border);
}

label {
  gap: .42rem;
  color: #314138;
  font-size: .82rem;
  font-weight: 650;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--ui-border-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--ui-ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

input, select { min-height: 46px; }
textarea { min-height: 96px; line-height: 1.55; }

input::placeholder,
textarea::placeholder { color: #9aa49e; }

input:hover, select:hover, textarea:hover { border-color: rgba(36,87,67,.34); }

input:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--ui-green-2);
  box-shadow: var(--ui-focus);
  background: #fff;
}

.campo-libre {
  padding: .9rem;
  border: 1px solid rgba(36,87,67,.12);
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbf8, #f4f8f5);
}

.campo-libre span {
  color: #26372f;
  font-size: .83rem;
}

.btn-ghost,
.btn-principal,
.documento-acciones button,
.btn-nivel,
.planeacion-item button {
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, border-color .14s ease;
}

.btn-ghost {
  margin-top: .65rem;
  min-height: 42px;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(18,50,37,.05);
}

.btn-ghost:hover { transform: translateY(-1px); box-shadow: var(--ui-shadow-sm); }

.btn-principal {
  position: relative;
  min-height: 52px;
  margin-top: .35rem;
  border-radius: 13px;
  background: linear-gradient(135deg, #173f31, #245743);
  box-shadow: 0 12px 26px rgba(23,63,49,.18);
  letter-spacing: -.01em;
}

.btn-principal:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #112f25, #1e4d3b);
  box-shadow: 0 15px 32px rgba(23,63,49,.24);
}

.btn-principal:active { transform: translateY(0); }

.estado-ia { color: var(--ui-muted); }

/* ---------- Document area ---------- */
.panel-documento {
  min-height: 690px;
  overflow: hidden;
  background: rgba(255,255,255,.84);
}

.documento-toolbar {
  min-height: 70px;
  padding: .9rem 1.15rem;
  border-bottom: 1px solid var(--ui-border);
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(14px);
}

.documento-label {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: #405047;
  font-size: .78rem;
  font-weight: 700;
}

.documento-label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ui-gold);
  box-shadow: 0 0 0 4px var(--ui-gold-soft);
}

.documento-acciones {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .4rem;
}

.documento-acciones button {
  margin-left: 0;
  min-height: 36px;
  border: 1px solid var(--ui-border);
  border-radius: 9px;
  background: #fff;
}

.documento-acciones button:hover {
  transform: translateY(-1px);
  border-color: rgba(36,87,67,.35);
  box-shadow: 0 5px 14px rgba(18,50,37,.07);
}

.editable-hint {
  margin: 0;
  padding: .7rem 1.25rem;
  color: #705d29;
  background: var(--ui-gold-soft);
  border-color: rgba(215,168,61,.22);
}

.nivel-lectura-bar {
  padding: .75rem 1.25rem;
  border-color: var(--ui-border);
  background: #fbfcfb;
}

.btn-nivel {
  border-radius: 9px;
  background: #fff;
}

.btn-nivel.activo {
  background: var(--ui-green);
  box-shadow: 0 5px 14px rgba(23,63,49,.14);
}

.documento-vacio {
  min-height: 570px;
  background:
    linear-gradient(90deg, transparent 49.85%, rgba(23,63,49,.035) 50%, transparent 50.15%),
    linear-gradient(transparent 49.85%, rgba(23,63,49,.035) 50%, transparent 50.15%);
  background-size: 36px 36px;
}

.documento-vacio p {
  max-width: 360px;
  padding: 1.4rem 1.55rem;
  border: 1px dashed rgba(36,87,67,.18);
  border-radius: 16px;
  background: rgba(255,255,255,.76);
  color: var(--ui-muted);
  line-height: 1.65;
  box-shadow: var(--ui-shadow-sm);
}

.documento {
  margin: 1.2rem;
  padding: clamp(1.6rem, 4vw, 3.2rem);
  border: 1px solid rgba(22,56,42,.10);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 38px rgba(19,48,37,.08);
}

.documento h1 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  letter-spacing: -.025em;
}

.documento h2 { letter-spacing: -.018em; }

.documento table {
  border-radius: 10px;
  overflow: hidden;
}

/* ---------- NEM card refinement ---------- */
.nem-box {
  border: 1px solid rgba(215,168,61,.24);
  border-left: 1px solid rgba(215,168,61,.24);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,248,225,.72), rgba(255,255,255,.82));
  box-shadow: 0 7px 22px rgba(74,58,17,.05);
}

.nem-fase { border-radius: 9px; }
.nem-ejes { border-radius: 10px; background: rgba(255,255,255,.58); }

.nem-badge-ok {
  background: #e9f5ed;
  color: #23573d;
}

/* ---------- Modals ---------- */
.modal-fondo {
  background: rgba(10,27,21,.58);
  backdrop-filter: blur(8px);
}

.modal-caja {
  max-width: 650px;
  max-height: min(86vh, 820px);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 22px;
  background: rgba(252,253,251,.98);
  box-shadow: 0 28px 90px rgba(9,31,22,.28);
  overflow: hidden;
}

.modal-header {
  padding: 1.15rem 1.35rem;
  border-color: var(--ui-border);
  background: #fff;
}

.modal-header h3 { letter-spacing: -.02em; }

.btn-cerrar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.btn-cerrar:hover { background: #eef2ef; }

.planeacion-item,
.recurso-item {
  margin: .55rem 0;
  padding: .85rem;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  background: #fff;
}

.planeacion-item button { border-radius: 9px; }

/* ---------- Motion / accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media (max-width: 980px) {
  .hero { padding-bottom: 5.5rem; }
  .hero-top { margin-bottom: 3.2rem; }
  .beneficios { margin-top: -2.5rem; }
  .mesa { grid-template-columns: 1fr; }
  .panel-intake { position: static; }
}

@media (max-width: 760px) {
  .hero {
    padding: 1rem 1rem 4.7rem;
    border-radius: 0 0 26px 26px;
  }

  .hero-top {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    margin-bottom: 2.5rem;
  }

  .auth-box { width: 100%; }
  .auth-form { display: grid; grid-template-columns: 1fr; }
  .auth-form input { width: 100%; }
  .auth-in { flex-wrap: wrap; }

  .hero h1 {
    font-size: clamp(2.35rem, 12vw, 3.6rem);
    line-height: 1.02;
  }

  .hero h1 br { display: none; }

  .beneficios {
    margin-top: -2rem;
    padding-inline: 1rem;
    gap: .8rem;
  }

  .beneficio,
  .beneficio:first-child {
    padding: 1.1rem;
    border-top: 1px solid var(--ui-border);
  }

  .mesa { padding-inline: 1rem; }
  .panel-intake { padding: 1.1rem; border-radius: 20px; }
  .panel-documento { border-radius: 20px; min-height: 580px; }
  .fila { grid-template-columns: 1fr; }
  .documento-toolbar { align-items: flex-start; gap: .75rem; flex-direction: column; }
  .documento-acciones { width: 100%; justify-content: flex-start; }
  .documento { margin: .7rem; padding: 1.25rem; border-radius: 14px; }
  .documento-vacio { min-height: 420px; }
}

@media (max-width: 430px) {
  .wordmark { font-size: 1.2rem; }
  .hero-chip { font-size: .7rem; }
  .documento-acciones button { flex: 1 1 auto; }
}

