/* Emoticon Capacita — estilos basados en la línea gráfica de emoticon.cl
   Tokens tomados del sitio oficial (variables :root --w-*) y tipografía Figtree. */
:root {
  --plum: #3d1838;
  --berry: #a3305a;
  --coral: #c2412b;
  --coral-hi: #ef5a3c;
  --orange: #e07a1f;
  --amber: #ffb547;
  --sun: #ffd46b;
  --cream: #fff7ee;
  --peach: #ffe9db;
  --sand: #fbf1e4;
  --teal: #0b7f89;
  --ink: #2a1626;
  --ink-2: #4a3446;
  --muted: #7a6474;
  --rule: #ecdccd;
  --white: #fff;
  --ok: #2e7d4f;
  --warn: #b26a00;
  --bad: #b3261e;
  --radius: 22px;
  --radius-sm: 12px;
  --shadow-card: 0 20px 40px -24px rgba(61, 24, 56, .6);
  --font: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); }
img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 247, 238, .95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header .inner {
  max-width: 1180px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 34px; width: auto; display: block; }
.brand .wordmark { font-weight: 600; font-size: 28px; color: var(--teal); letter-spacing: -1px; }
.brand .tag {
  font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--coral); border: 1px solid currentColor; border-radius: 999px; padding: 2px 10px;
}
.header-links { display: flex; align-items: center; gap: 18px; font-size: 15px; }
.header-links a:not(.btn) { color: var(--ink); text-decoration: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 500 16px/1 var(--font); border: 0; border-radius: 999px; cursor: pointer;
  padding: 14px 24px; text-decoration: none; transition: transform .12s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-sun { background: var(--sun); color: var(--plum); box-shadow: 0 10px 24px -10px rgba(0,0,0,.5); }
.btn-coral { background: var(--coral); color: #fff; box-shadow: 0 8px 18px -8px rgba(194,65,43,.6); }
.btn-ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--ink-2); }
.btn-plain { background: transparent; color: var(--ink-2); padding: 8px 12px; }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-danger { background: transparent; color: var(--bad); border: 1px solid var(--bad); }
.btn-ok { background: var(--ok); color: #fff; }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background: linear-gradient(120deg, var(--plum) 0%, var(--berry) 55%, var(--coral) 85%, var(--orange) 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 85% 20%, rgba(255,212,107,.35), transparent 45%);
}
.hero .inner {
  position: relative; z-index: 1; max-width: 1180px; margin: 0 auto;
  padding: 64px 20px 72px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: start;
}
.hero h1 {
  font-weight: 600; font-size: clamp(40px, 3rem + 2.5vw, 72px); line-height: 1.02;
  letter-spacing: -0.035em; margin: 0 0 20px;
}
.hero .lead { font-size: clamp(19px, 1.1rem + .4vw, 23px); color: rgba(255,255,255,.93); margin: 0 0 28px; max-width: 34ch; }
.hero .lead b { font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px; padding: 7px 14px;
}
.steps { margin: 32px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; max-width: 460px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; color: rgba(255,255,255,.93); font-size: 16px; }
.steps .n {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sun); color: var(--plum); font-weight: 600; font-size: 15px;
}

/* ---------- Form card ---------- */
.card {
  background: var(--cream); color: var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow-card); padding: 32px;
}
.card h2 { font-size: 28px; letter-spacing: -0.02em; margin: 0 0 6px; color: var(--plum); font-weight: 600; }
.card .sub { color: var(--muted); margin: 0 0 22px; font-size: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 13px; color: var(--muted); }
.field .err { font-size: 13px; color: var(--bad); min-height: 0; }
input[type=text], input[type=tel], input[type=email], input[type=number], input[type=password], select, textarea {
  font: 400 16px var(--font); color: var(--ink); background: #fff;
  border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: 12px 14px; width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(11,127,137,.18); }
.invalid input, .invalid select { border-color: var(--bad); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--coral); }
.form-actions { margin-top: 22px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.form-msg { font-size: 15px; }
.form-msg.error { color: var(--bad); }

.result { text-align: center; padding: 12px 4px; }
.result .icon { font-size: 44px; }
.result h2 { margin-top: 8px; }
.result .wa { margin-top: 18px; }

/* ---------- Info section ---------- */
.section { max-width: 1180px; margin: 0 auto; padding: 72px 20px; }
.section h2.big { font-size: clamp(32px, 1.6rem + 2.4vw, 52px); letter-spacing: -0.035em; line-height: 1.05; color: var(--plum); margin: 0 0 14px; font-weight: 600; }
.section .kicker { color: var(--coral); font-weight: 600; text-transform: uppercase; font-size: 14px; letter-spacing: .08em; }
.modules { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 32px; padding: 0; list-style: none; }
.module { border-radius: var(--radius); padding: 22px; color: #fff; min-height: 180px; box-shadow: var(--shadow-card); }
.module:nth-child(1) { background: linear-gradient(140deg, var(--orange), var(--coral)); }
.module:nth-child(2) { background: linear-gradient(140deg, var(--coral), var(--berry)); }
.module:nth-child(3) { background: linear-gradient(140deg, var(--berry), var(--plum)); }
.module:nth-child(4) { background: linear-gradient(140deg, var(--teal), #075e66); }
.module .m { font-family: var(--mono); font-size: 13px; opacity: .85; }
.module h3 { margin: 8px 0 6px; font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.module p { margin: 0; font-size: 15px; color: rgba(255,255,255,.9); }
.band-peach { background: var(--peach); }

/* ---------- Footer ---------- */
.site-footer { background: var(--plum); color: rgba(255,255,255,.72); font-size: 15px; }
.site-footer .inner { max-width: 1180px; margin: 0 auto; padding: 40px 20px; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer strong { color: #fff; font-weight: 600; }
.site-footer a { color: rgba(255,255,255,.85); }
.demo-banner {
  background: var(--sun); color: var(--plum); text-align: center; font-size: 14px; font-weight: 500; padding: 6px 12px;
}

/* ---------- Admin ---------- */
.admin { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--plum); color: rgba(255,255,255,.85); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.sidebar .brand { padding: 4px 10px 18px; }
.sidebar .brand .wordmark { color: #fff; font-size: 24px; }
.sidebar .brand .tag { color: var(--sun); }
.sidebar .group { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.5); padding: 14px 10px 6px; }
.sidebar a { color: rgba(255,255,255,.85); text-decoration: none; padding: 9px 12px; border-radius: 10px; font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
.sidebar a:hover { background: rgba(255,255,255,.08); }
.sidebar a.active { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; }
.sidebar .badge { background: var(--sun); color: var(--plum); border-radius: 999px; font-size: 12px; font-weight: 600; padding: 1px 8px; }
.sidebar .foot { margin-top: auto; font-size: 13px; padding: 12px 10px 0; color: rgba(255,255,255,.55); }
.main { padding: 28px 32px 60px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 32px; letter-spacing: -0.025em; color: var(--plum); font-weight: 600; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.panel { background: #fff; border: 1px solid var(--rule); border-radius: 18px; padding: 20px; margin-bottom: 18px; }
.panel h2 { font-size: 19px; margin: 0 0 14px; color: var(--plum); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--rule); border-radius: 16px; padding: 16px; }
.stat .v { font-size: 32px; font-weight: 600; color: var(--plum); letter-spacing: -0.02em; }
.stat .l { font-size: 14px; color: var(--muted); }
.stat.hl { background: var(--sun); border-color: var(--sun); }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { font: 500 14px var(--font); border: 1px solid var(--rule); background: #fff; color: var(--ink-2); border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.tabs button.on { background: var(--plum); color: #fff; border-color: var(--plum); }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input[type=text] { max-width: 280px; padding: 9px 12px; font-size: 15px; }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.t th { text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
table.t td { padding: 11px 10px; border-bottom: 1px solid #f3e8dc; vertical-align: middle; }
table.t tr:hover td { background: #fffaf4; }
table.t .actions { white-space: nowrap; display: flex; gap: 6px; }
.mono { font-family: var(--mono); font-size: 13.5px; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.sub2 { color: var(--muted); font-size: 13px; }
.pill { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill.pendiente { background: #fff1cc; color: #7a5200; }
.pill.aprobada, .pill.aprobado { background: #dcf2e4; color: var(--ok); }
.pill.rechazada, .pill.bloqueado, .pill.reprobado_derivado { background: #fde2df; color: var(--bad); }
.pill.inscrito { background: #e3f1f2; color: var(--teal); }
.pill.en_curso, .pill.evaluacion_pendiente { background: #efe3ee; color: var(--berry); }
.pill.expirado { background: #eee; color: #666; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.cfg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.cfg-grid .field input, .cfg-grid .field select { max-width: 100%; }
.note { background: var(--sand); border-left: 4px solid var(--amber); padding: 12px 14px; border-radius: 10px; font-size: 14.5px; color: var(--ink-2); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--plum); color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 15px; box-shadow: var(--shadow-card); z-index: 100; }
dialog { border: 0; border-radius: var(--radius); padding: 0; max-width: 560px; width: calc(100% - 32px); box-shadow: var(--shadow-card); background: var(--cream); color: var(--ink); }
dialog::backdrop { background: rgba(42,22,38,.45); }
dialog .dlg { padding: 24px; }
dialog h3 { margin: 0 0 14px; color: var(--plum); font-size: 21px; }
dialog .dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(120deg, var(--plum), var(--berry) 60%, var(--coral)); }
.login .card { width: 100%; max-width: 420px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero .inner { grid-template-columns: 1fr; padding: 40px 16px 48px; gap: 28px; }
  .modules { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .sidebar .group, .sidebar .foot { display: none; }
  .main { padding: 20px 16px 48px; }
  .cfg-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .form-grid { grid-template-columns: 1fr; }
  .card { padding: 22px 18px; }
  .modules { grid-template-columns: 1fr; }
  .header-links .hide-sm { display: none; }
  .section { padding: 48px 16px; }
}
