/* ==================================================================
   Emtech Alumni · look & feel Emtech Institute
   ================================================================== */
:root {
  --blue: #1165F6;
  --blue-600: #0b55d6;
  --blue-50: #eef4ff;
  --navy: #00215B;
  --navy-700: #001a48;
  --cyan: #25C7D9;
  --mint: #4FE0DC;
  --violet: #5B3DF5;
  --grad: linear-gradient(100deg, #4FE0DC 0%, #1165F6 55%, #5B3DF5 100%);

  --ink: #0d1b3a;
  --ink-2: #44506a;
  --muted: #6b7690;
  --line: #e3e8f2;
  --bg: #f5f7fc;
  --card: #ffffff;

  --ok: #0f9d6b;   --ok-bg: #e6f7f0;
  --warn: #b26b00; --warn-bg: #fff4de;
  --err: #d23246;  --err-bg: #fdecee;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 33, 91, .05), 0 8px 24px -12px rgba(0, 33, 91, .12);
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.5 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.015em; }
h1 { font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 800; color: var(--navy); }
h2 { font-size: 1.1rem; font-weight: 700; color: var(--navy); }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 .8em; }
code { font-family: var(--mono); font-size: .86em; background: var(--blue-50); color: var(--navy); padding: .1em .35em; border-radius: 5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.upper { text-transform: uppercase; }
.nowrap { white-space: nowrap; }
.ta-r { text-align: right; }
.ta-c { text-align: center; }
.mt { margin-top: 1rem; }
.ellipsis { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link { color: var(--blue); font-weight: 600; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }

/* ---------- Botones ---------- */
.btn {
  --b: var(--navy);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .62em 1.1em;
  font: 600 .92rem/1.2 var(--font);
  color: var(--b);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
  text-decoration: none !important;
  white-space: nowrap;
}
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(17, 101, 246, .35); outline-offset: 2px;
}
.btn--primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 6px 16px -8px rgba(17, 101, 246, .7); }
.btn--primary:hover { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: var(--blue-50); border-color: transparent; }
.btn--danger { color: var(--err) !important; }
.btn--danger:hover { background: var(--err-bg) !important; }
.btn--sm { padding: .42em .85em; font-size: .82rem; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn--linkedin { background: #0A66C2; border-color: #0A66C2; color: #fff; }
.btn--linkedin:hover { background: #084f96; border-color: #084f96; color: #fff; }

/* ---------- Formularios ---------- */
.form { display: grid; gap: .9rem; }
.form fieldset { border: 0; padding: 0; margin: 0 0 .6rem; display: grid; gap: .9rem; }
.form legend { font-weight: 700; color: var(--navy); margin-bottom: .6rem; font-size: 1rem; }
label { display: grid; gap: .35rem; font-weight: 600; font-size: .86rem; color: var(--ink-2); }
label small { font-weight: 400; color: var(--muted); }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select, textarea {
  width: 100%;
  padding: .66em .85em;
  font: 400 .95rem/1.35 var(--font);
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 4px rgba(17, 101, 246, .12); }
textarea { resize: vertical; min-height: 3em; }
input[type=file] { font: inherit; font-size: .85rem; }
.check { display: flex; align-items: center; gap: .55rem; font-weight: 500; cursor: pointer; }
.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--blue); }
.color-field { display: flex; align-items: center; gap: .6rem; }
.color-field input[type=color] { width: 44px; height: 36px; border: 1.5px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; cursor: pointer; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.2rem; margin-top: 1rem; }

/* ---------- Alertas / etiquetas ---------- */
.alert { padding: .8rem 1rem; border-radius: 10px; margin: 0 0 1rem; font-size: .92rem; border: 1px solid transparent; }
.alert--success { background: var(--ok-bg); color: #075e40; border-color: #bfe9d7; }
.alert--error { background: var(--err-bg); color: #9b1c2e; border-color: #f6c6cd; }
.alert--warning { background: var(--warn-bg); color: #7a4a00; border-color: #f6dca6; }
.alert--info { background: var(--blue-50); color: var(--navy); border-color: #cfe0ff; }

.badge { display: inline-block; padding: .12em .5em; font: 700 .72rem/1.4 var(--mono); letter-spacing: .04em; color: var(--blue); background: var(--blue-50); border-radius: 6px; vertical-align: 1px; }
.badge--float { position: absolute; left: .6rem; top: .6rem; background: rgba(255, 255, 255, .92); }
.tag { display: inline-block; margin: 0 .25rem .15rem 0; padding: .14em .55em; font-size: .76rem; font-weight: 600; border-radius: 999px; }
.tag--ok { background: var(--ok-bg); color: var(--ok); }
.tag--warn { background: var(--warn-bg); color: var(--warn); }
.tag--err { background: var(--err-bg); color: var(--err); }
.pills { display: flex; gap: .4rem; flex-wrap: wrap; }
.pill { padding: .3em .8em; border-radius: 999px; font-weight: 700; font-size: .82rem; }
.pill--ok { background: var(--ok-bg); color: var(--ok); }
.pill--warn { background: var(--warn-bg); color: var(--warn); }
.pill--err { background: var(--err-bg); color: var(--err); }

/* ---------- Layout admin ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar::after { content: ""; display: block; height: 3px; background: var(--grad); }
.topbar__inner { max-width: 1280px; margin: 0 auto; padding: .7rem 1.25rem; display: flex; align-items: center; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none !important; }
.brand img { display: block; height: 30px; width: auto; }
.brand__tag { font-weight: 700; font-size: .8rem; color: #fff; background: var(--navy); padding: .18em .6em; border-radius: 6px; letter-spacing: .02em; }
.nav { display: flex; gap: .2rem; flex: 1; overflow-x: auto; }
.nav a, .topbar__user > a:not(.btn) { padding: .5em .85em; border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: .9rem; white-space: nowrap; text-decoration: none; }
.nav a:hover, .topbar__user > a:not(.btn):hover { background: var(--blue-50); color: var(--blue); }
.nav a.is-active, .topbar__user a.is-active { background: var(--blue-50); color: var(--blue); }
.topbar__user { display: flex; align-items: center; gap: .3rem; }

.container { max-width: 1280px; margin: 0 auto; padding: 1.75rem 1.25rem 3rem; }
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 1.5rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head h1 { margin-bottom: .15rem; }
.page-head p { margin: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); }
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }

.grid { display: grid; gap: 1rem; }
.grid > * { min-width: 0; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.grid--detail { grid-template-columns: minmax(0, 1fr) 360px; gap: 1.4rem; align-items: start; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--grad); }
.stat__n { display: block; font-size: 1.9rem; font-weight: 800; color: var(--navy); letter-spacing: -.02em; }
.stat__l { color: var(--muted); font-size: .85rem; font-weight: 600; }

/* ---------- Tablas ---------- */
.table-wrap { overflow: auto; }
.table-wrap--tall { max-height: 560px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: .7rem .9rem; border-bottom: 1px solid var(--line); background: #fafbfe; position: sticky; top: 0; z-index: 1; }
.table td { padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: #fafcff; }
.table tbody tr:last-child td { border-bottom: 0; }
.table--compact td, .table--compact th { padding: .5rem .7rem; }
.row--err { background: #fff7f8; }
.row--warn { background: #fffcf4; }
.row--done td:last-child::after { content: "✓"; color: var(--ok); font-weight: 800; }

.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; padding: .8rem; }
.filters input[type=search] { flex: 2 1 260px; }
.filters select { flex: 1 1 180px; width: auto; }

.pager { display: flex; gap: .3rem; justify-content: center; margin-top: 1.2rem; }
.pager a, .pager span { min-width: 2.2rem; padding: .4rem .6rem; text-align: center; border-radius: 8px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; font-size: .85rem; }
.pager a.is-active { background: var(--blue); border-color: var(--blue); color: #fff; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; flex-direction: column; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed a { font-weight: 600; }

/* ---------- Programas ---------- */
.program-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.2rem; }
.program-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.program-card.is-off { opacity: .6; }
.program-card__thumb { position: relative; display: block; aspect-ratio: 1056 / 816; background: var(--navy); }
.program-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.program-card__body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; flex: 1; }
.program-card__body h3 { margin-bottom: .2rem; color: var(--navy); }
.program-card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-top: .6rem; }

.editor { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.editor__form { display: grid; gap: .9rem; }
.editor__form .grid--3 { grid-template-columns: 1fr .8fr 1.5fr; }
.editor__form h2.mt { margin-top: 1rem; }
.sticky { position: sticky; top: 90px; }
.preview-label { font-weight: 700; color: var(--navy); margin-bottom: .6rem; font-size: .9rem; }

/* ---------- Importar ---------- */
.dropzone {
  position: relative; display: grid; place-items: center; gap: .3rem; text-align: center;
  padding: 2.2rem 1rem; border: 2px dashed #c9d6f0; border-radius: var(--radius); background: #fafcff;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--blue); background: var(--blue-50); }
.dropzone.has-file { border-style: solid; border-color: var(--ok); background: var(--ok-bg); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone__icon { font-size: 1.8rem; color: var(--blue); line-height: 1; }
details summary { cursor: pointer; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details[open] summary { margin-bottom: .6rem; }

/* ---------- Lote / progreso ---------- */
.parts { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-bottom: 1.2rem; padding: .9rem 1.1rem; }
.parts__list { display: flex; flex-wrap: wrap; gap: .4rem; }
.parts__list a { padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--line); font-weight: 600; font-size: .85rem; color: var(--ink-2); text-decoration: none; }
.parts__list a.is-active { background: var(--blue); border-color: var(--blue); color: #fff; }
.parts__list a.is-active .muted { color: rgba(255,255,255,.75); }
.batch-actions { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; }
.progress { margin-top: 1rem; }
.progress__bar { height: 10px; border-radius: 999px; background: var(--blue-50); overflow: hidden; }
.progress__bar span { display: block; height: 100%; width: 0; background: var(--grad); transition: width .2s; }
.progress p { margin: .5rem 0 0; display: flex; gap: .8rem; align-items: center; }

.export-card__btns { display: grid; gap: .5rem; }
.mt-0 { margin-top: 0; }
.copy-field { display: flex; gap: .5rem; align-items: center; }
.copy-field input { flex: 1; }
.danger-zone { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- Login / instalador ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: radial-gradient(1200px 600px at 10% -10%, rgba(79, 224, 220, .25), transparent 60%), radial-gradient(900px 600px at 110% 110%, rgba(91, 61, 245, .22), transparent 60%), var(--navy); }
.auth__card { width: 100%; max-width: 420px; background: #fff; border-radius: 20px; padding: 2rem; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .5); }
.auth__card--wide { max-width: 640px; }
.auth__logo { display: block; height: 40px; width: auto; margin-bottom: 1.4rem; }
.steps { padding-left: 1.2rem; }
.steps li { margin-bottom: .4rem; }

/* ---------- Sitio público ---------- */
.public { background: #fff; display: flex; flex-direction: column; min-height: 100vh; }
.public > main { flex: 1; }
.pub-top { border-bottom: 1px solid var(--line); background: #fff; }
.pub-top::after { content: ""; display: block; height: 3px; background: var(--grad); }
.pub-top__inner { max-width: 1180px; margin: 0 auto; padding: .9rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.pub-top .brand img { height: 34px; }
.pub-top__label { font-weight: 600; color: var(--muted); font-size: .88rem; }

.eyebrow { display: inline-block; font-weight: 700; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); margin-bottom: .6rem; }

.hero { background: radial-gradient(900px 500px at 0% 0%, rgba(79, 224, 220, .22), transparent 60%), radial-gradient(800px 600px at 100% 100%, rgba(91, 61, 245, .28), transparent 60%), var(--navy); color: #fff; padding: 4.5rem 1.25rem; }
.hero__inner { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(2rem, 4vw, 3rem); }
.hero p { color: rgba(255, 255, 255, .8); font-size: 1.08rem; max-width: 520px; }
.verify-card { background: #fff; color: var(--ink); border-radius: 20px; padding: 1.8rem; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .55); }
.divider { display: flex; align-items: center; gap: .8rem; color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

.result { max-width: 1180px; width: 100%; margin: 0 auto; padding: 2.2rem 1.25rem 3.5rem; }
.status { display: flex; gap: 1.2rem; align-items: flex-start; padding: 1.5rem 1.6rem; border-radius: 18px; margin-bottom: 1.8rem; border: 1px solid; }
.status h1 { margin-bottom: .3rem; }
.status p { margin: 0 0 .4rem; color: var(--ink-2); max-width: 760px; }
.status .eyebrow { margin-bottom: .3rem; }
.status--ok { background: linear-gradient(100deg, #e9fbf7, #eef4ff); border-color: #c8eee2; }
.status--ok .eyebrow { color: var(--ok); }
.status--error { background: var(--err-bg); border-color: #f6c6cd; }
.status--error .eyebrow { color: var(--err); }
.status--error .btn { margin-top: .6rem; }
.status__icon { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; color: #fff; }
.status--ok .status__icon { background: var(--ok); box-shadow: 0 0 0 6px rgba(15, 157, 107, .15); }
.status--error .status__icon { background: var(--err); box-shadow: 0 0 0 6px rgba(210, 50, 70, .15); }

.result__grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 1.8rem; align-items: start; }
.details { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); position: sticky; top: 1rem; }
.details dl { margin: 0; display: grid; gap: .85rem; }
.details dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.details dd { margin: .1rem 0 0; font-weight: 600; color: var(--navy); }
.details__actions { display: grid; gap: .6rem; margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.details__row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.result__cert .printable { margin-bottom: .8rem; }

.pub-foot { background: var(--navy); color: rgba(255, 255, 255, .72); }
.pub-foot__inner { max-width: 1180px; margin: 0 auto; padding: 2rem 1.25rem; display: grid; gap: .6rem; font-size: .88rem; }
.pub-foot img { height: 28px; width: auto; margin-bottom: .4rem; }
.pub-foot p { margin: 0; max-width: 760px; }
.pub-foot a { color: #fff; }
.pub-foot__small { font-size: .78rem; opacity: .7; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--navy); color: #fff; padding: .7rem 1.1rem; border-radius: 999px; font-weight: 600; font-size: .9rem; opacity: 0; transition: .2s; z-index: 99; pointer-events: none; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .4); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .editor, .grid--detail, .grid--2-1 { grid-template-columns: 1fr; }
  .editor__preview { order: -1; }
  .sticky { position: static; }
}
@media (max-width: 900px) {
  .hero__inner, .result__grid { grid-template-columns: 1fr; }
  .result__cert { order: -1; }
  .details { position: static; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar__inner { flex-wrap: wrap; gap: .6rem; }
  .nav { order: 3; flex-basis: 100%; }
  .topbar__user { margin-left: auto; }
}
@media (max-width: 560px) {
  body { font-size: 14.5px; }
  .container, .result { padding-left: 16px; padding-right: 16px; }
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .hero { padding: 2.5rem 16px; }
  .pub-top__label { display: none; }
  .status { flex-direction: column; padding: 1.2rem; }
  .copy-field { flex-wrap: wrap; }
  .page-head .nowrap { white-space: normal; display: flex; flex-wrap: wrap; gap: .4rem; }
}
