/* EA University. Estilos del intranet. Paleta tomada de enjoyapartments.com */
:root {
  --navy: #1b2b4b;
  --navy-700: #243a63;
  --navy-50: #eef1f7;
  --emerald: #10b981;
  --emerald-600: #059669;
  --bg: #f8f7f4;
  --surface: #ffffff;
  --line: #e3e0d8;
  --ink: #1f2937;
  --muted: #6b7280;
  --soft: #d9e0ec;
  --gold: #c89b3c;
  --danger: #c0392b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(27,43,75,.06), 0 8px 24px rgba(27,43,75,.06);
  --serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; color: var(--navy); line-height: 1.2; }

/* Barra superior */
.topbar {
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.brand .mark {
  width: 38px; height: 38px; border-radius: 9px;
  background: var(--emerald);
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 20px; color: var(--navy); font-weight: 700;
}
.brand .mark-img { width: 40px; height: 40px; object-fit: contain; display: block; }
.brand .name { font-family: var(--serif); font-size: 21px; color: #fff; }
.brand .name small { display: block; font-family: var(--sans); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--soft); }
.topnav { display: flex; align-items: center; gap: 8px; }
.topnav a { color: #dfe5ee; padding: 8px 12px; border-radius: 8px; font-size: 14px; }
.topnav a:hover { background: var(--navy-700); text-decoration: none; }
.topnav a.active { background: var(--navy-700); color: #fff; }
.userchip { display: flex; align-items: center; gap: 10px; margin-left: 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--emerald); color: var(--navy); display: grid; place-items: center; font-weight: 600; font-size: 14px; }

/* Layout */
.container { max-width: 1080px; margin: 0 auto; padding: 32px 24px 80px; }
.container.narrow { max-width: 760px; }
.container.reading { max-width: 820px; }

/* Tarjetas */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

/* Botones */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--navy); color: #fff; border: none;
  padding: 11px 18px; border-radius: 10px; font-size: 15px; font-weight: 500;
  font-family: var(--sans); cursor: pointer; transition: background .15s, transform .05s;
}
.btn:hover { background: var(--navy-700); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.accent { background: var(--emerald); color: var(--navy); font-weight: 600; }
.btn.accent:hover { background: var(--emerald-600); color: #fff; }
.btn.ghost { background: transparent; color: var(--navy); border: 1px solid var(--soft); }
.btn.ghost:hover { background: var(--navy-50); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 7px 12px; font-size: 13px; }

/* Formularios */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--soft);
  border-radius: 10px; font-size: 15px; font-family: var(--sans); background: #fff; color: var(--ink);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-50); }
.field textarea { min-height: 180px; resize: vertical; }

/* Mensajes */
.alert { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }
.alert.error { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c0; }
.alert.success { background: #e7f7f0; color: var(--emerald-600); border: 1px solid #b6e6d4; }
.alert.info { background: var(--navy-50); color: var(--navy); border: 1px solid var(--soft); }

/* Pildoras y badges */
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; letter-spacing: .03em; }
.pill.foundation { background: #fdf3df; color: #9a7416; }
.pill.pro { background: var(--navy-50); color: var(--navy); }
.pill.passed { background: #e7f7f0; color: var(--emerald-600); }
.pill.locked { background: #f1efe9; color: var(--muted); }

/* Auth */
.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 30px; margin: 0 0 4px; }
.auth-sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.tabs { display: flex; gap: 6px; margin-bottom: 20px; background: var(--navy-50); padding: 4px; border-radius: 10px; }
.tabs button { flex: 1; border: none; background: transparent; padding: 9px; border-radius: 8px; font-family: var(--sans); font-size: 14px; font-weight: 500; cursor: pointer; color: var(--navy); }
.tabs button.active { background: #fff; box-shadow: var(--shadow); }

/* Hero del dashboard */
.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-700) 100%); color: #fff; border-radius: var(--radius); padding: 30px 32px; margin-bottom: 26px; }
.hero h1 { color: #fff; font-size: 30px; margin: 0 0 6px; }
.hero p { color: var(--soft); margin: 0; }
.hero .stats { display: flex; gap: 28px; margin-top: 22px; flex-wrap: wrap; }
.hero .stat .num { font-family: var(--serif); font-size: 30px; color: #fff; }
.hero .stat .lbl { font-size: 12px; color: var(--soft); text-transform: uppercase; letter-spacing: .08em; }
.progressbar { height: 8px; background: rgba(255,255,255,.18); border-radius: 99px; margin-top: 18px; overflow: hidden; }
.progressbar > div { height: 100%; background: var(--emerald); border-radius: 99px; transition: width .5s; }

/* Lista de modulos */
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 30px 0 14px; }
.section-title h2 { font-size: 22px; margin: 0; }
.modcard { display: flex; flex-direction: column; cursor: pointer; transition: transform .1s, box-shadow .15s; }
.modcard:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(27,43,75,.12); }
.modcard .mnum { font-family: var(--serif); font-size: 13px; color: var(--emerald-600); letter-spacing: .05em; }
.modcard h3 { font-size: 19px; margin: 4px 0 8px; }
.modcard .meta { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.modcard .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.modcard .tags { display: flex; gap: 6px; }

/* Credenciales */
.credgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.credcard {
  display: flex; gap: 16px; align-items: center;
  border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: #fff;
}
.credcard.on { border-color: var(--emerald); background: linear-gradient(135deg, #f3fbf7, #ffffff); }
.credcard .medal {
  width: 58px; height: 58px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: #f1efe9; border: 2px solid var(--line);
}
.credcard.on .medal { background: var(--navy); border-color: var(--emerald); }
.credcard .medal img { width: 34px; height: 34px; object-fit: contain; }
.credcard .info { min-width: 0; flex: 1; }
.credcard .t { font-family: var(--serif); font-size: 18px; color: var(--navy); line-height: 1.2; }
.credcard .s { font-size: 12px; color: var(--muted); margin: 2px 0 8px; }
.miniprog { height: 6px; background: var(--navy-50); border-radius: 99px; overflow: hidden; max-width: 220px; }
.miniprog > div { height: 100%; background: var(--emerald); border-radius: 99px; }
.modbadges-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 18px 0 10px; }
.modbadges { display: flex; flex-wrap: wrap; gap: 10px; }
.modbadge {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  font-size: 12px; font-weight: 600;
  background: #f1efe9; color: #b4b2a9; border: 1.5px solid var(--line);
  cursor: default;
}
.modbadge.on { background: var(--emerald); color: var(--navy); border-color: var(--emerald-600); }
.modbadge.on::after {
  content: "✓"; position: absolute; right: -3px; top: -3px;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--navy); color: #fff; font-size: 10px;
  display: grid; place-items: center; border: 1.5px solid #fff;
}

/* Lectura del modulo */
.reading { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px 46px; }
.reading h1 { font-size: 17px; color: var(--emerald-600); letter-spacing: .08em; text-transform: uppercase; }
.reading h2 { font-size: 27px; margin: 6px 0 18px; }
.reading h3 { font-size: 21px; margin: 30px 0 10px; }
.reading h4 { font-size: 17px; margin: 22px 0 8px; }
.reading p { margin: 0 0 14px; }
.reading ul, .reading ol { margin: 0 0 16px; padding-left: 22px; }
.reading li { margin-bottom: 6px; }
.reading hr { border: none; border-top: 1px solid var(--line); margin: 26px 0; }
.reading blockquote { margin: 18px 0; padding: 14px 20px; background: var(--navy-50); border-left: 4px solid var(--emerald); border-radius: 0 10px 10px 0; color: var(--navy); }
.reading blockquote p { margin: 0 0 8px; }
.reading blockquote p:last-child { margin: 0; }
.reading table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.reading th, .reading td { border: 1px solid var(--line); padding: 8px 11px; text-align: left; vertical-align: top; }
.reading th { background: var(--navy-50); color: var(--navy); font-weight: 600; }
.reading code { background: var(--navy-50); padding: 1px 6px; border-radius: 5px; font-size: 90%; }

/* Cuestionario */
.quiz-q { padding: 18px 0; border-bottom: 1px solid var(--line); }
.quiz-q .stem { font-weight: 600; margin-bottom: 12px; color: var(--navy); }
.quiz-q .stem .qn { color: var(--emerald-600); margin-right: 6px; }
.opt { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border: 1px solid var(--soft); border-radius: 9px; margin-bottom: 8px; cursor: pointer; transition: border-color .1s, background .1s; }
.opt:hover { border-color: var(--navy); background: var(--navy-50); }
.opt input { margin-top: 4px; }
.opt.correct { border-color: var(--emerald); background: #eefaf4; }
.opt.wrong { border-color: var(--danger); background: #fdecea; }
.opt .lt { font-weight: 600; text-transform: uppercase; }

.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(248,247,244,0), var(--bg) 40%); padding: 18px 0 4px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* Score */
.scorebox { text-align: center; padding: 26px; }
.scorebox .big { font-family: var(--serif); font-size: 56px; line-height: 1; }
.scorebox.pass .big { color: var(--emerald-600); }
.scorebox.fail .big { color: var(--danger); }

/* Tabla registro */
.regtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.regtable th, .regtable td { border-bottom: 1px solid var(--line); padding: 9px 8px; text-align: center; }
.regtable th { background: var(--navy); color: #fff; font-weight: 500; }
.regtable td.name { text-align: left; font-weight: 600; color: var(--navy); }
.regtable .ok { color: var(--emerald-600); font-weight: 700; }
.regtable .no { color: var(--soft); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }

/* Certificado */
.cert {
  background: #fff; border: 2px solid var(--navy); border-radius: 8px;
  padding: 54px 60px; text-align: center; position: relative;
  box-shadow: var(--shadow);
}
.cert::before { content: ""; position: absolute; inset: 12px; border: 1px solid var(--gold); border-radius: 4px; pointer-events: none; }
.cert .seal { width: 70px; height: 70px; border-radius: 50%; background: var(--emerald); color: var(--navy); display: grid; place-items: center; font-family: var(--serif); font-size: 30px; margin: 0 auto 16px; }
.cert .kicker { letter-spacing: .22em; text-transform: uppercase; font-size: 12px; color: var(--muted); }
.cert h1 { font-size: 40px; margin: 8px 0; }
.cert .recip { font-family: var(--serif); font-size: 32px; color: var(--emerald-600); margin: 18px 0 6px; }
.cert .desc { color: var(--muted); max-width: 560px; margin: 0 auto 18px; }
.cert .credmeta { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; margin-top: 22px; font-size: 13px; }
.cert .credmeta div span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.cert .cid { margin-top: 22px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--navy); }

.muted { color: var(--muted); }
.center { text-align: center; }
.spacer { height: 18px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.hidden { display: none !important; }

@media print {
  .topbar, .sticky-actions, .btn, .no-print { display: none !important; }
  body { background: #fff; }
  .cert { border-color: #1b2b4b; box-shadow: none; }
}
@media (max-width: 640px) {
  .reading { padding: 24px 20px; }
  .topnav a { padding: 8px 8px; font-size: 13px; }
  .hero { padding: 22px; }
}
