/* =========================================================================
   Sidif del Caribe — Portal de Concientización
   Marca: navy #01325C · navy oscuro #0D2746 · granate #7D0E0F
   Tipos: Montserrat (títulos) · Poppins (apoyos) · Open Sans (cuerpo)
   ========================================================================= */

:root {
  --navy: #01325C;
  --navy-900: #0D2746;
  --navy-950: #081a30;
  --navy-700: #0a3f6e;
  --granate: #7D0E0F;
  --granate-600: #9a1618;
  --granate-400: #c23537;

  --ink: #10243a;
  --muted: #5a6b7d;
  --line: #e4e9f0;
  --paper: #eef2f8;
  --card: #ffffff;

  --ok: #1a7f4b;
  --ok-bg: #e7f5ee;
  --warn: #b4530c;
  --warn-bg: #fdf0e4;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-lg: 0 30px 70px -28px rgba(1, 25, 48, .55);
  --shadow-md: 0 14px 34px -18px rgba(1, 25, 48, .35);
  --maxw: 880px;

  --font-title: "Montserrat", system-ui, sans-serif;
  --font-ui: "Poppins", system-ui, sans-serif;
  --font-body: "Open Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 10px 30px -20px rgba(0, 0, 0, .8);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand-mark {
  display: grid; place-items: center;
  width: 46px; height: 46px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--font-title); font-weight: 800; letter-spacing: .3px; font-size: 1.02rem; }
.brand-text small { font-size: .64rem; letter-spacing: .18em; text-transform: uppercase; color: #a9c4dd; margin-top: 3px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.who { font-family: var(--font-ui); font-size: .82rem; color: #cfe0ef; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-toggle {
  font-family: var(--font-ui); font-weight: 600; font-size: .78rem;
  color: #fff; text-decoration: none; letter-spacing: .04em;
  padding: 7px 13px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px;
  transition: background .18s, border-color .18s;
}
.lang-toggle:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .4); }

/* ---------- Hero (pantallas de una tarjeta) ---------- */
.hero {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  padding: clamp(32px, 7vw, 80px) 20px;
  background:
    radial-gradient(1100px 620px at 50% -10%, var(--navy-700) 0%, var(--navy-900) 42%, var(--navy-950) 100%);
  overflow: hidden;
}
.hero-aura {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(520px 320px at 82% 18%, rgba(125, 14, 15, .34), transparent 70%),
    radial-gradient(420px 300px at 12% 88%, rgba(10, 63, 110, .55), transparent 70%);
  mask-image: radial-gradient(90% 90% at 50% 40%, #000 60%, transparent 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  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: 46px 46px;
  mask-image: radial-gradient(70% 70% at 50% 35%, #000 0%, transparent 75%);
}

/* ---------- Tarjetas ---------- */
.card {
  position: relative; z-index: 1;
  width: 100%; max-width: 580px;
  background: var(--card);
  border-radius: var(--radius);
  padding: clamp(28px, 5vw, 46px);
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: rise .5s cubic-bezier(.2, .7, .2, 1) both;
}
.card-narrow { max-width: 440px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.card h1 { font-family: var(--font-title); font-weight: 800; color: var(--navy); font-size: clamp(1.5rem, 3.6vw, 2.1rem); line-height: 1.15; margin: 6px 0 14px; letter-spacing: -.3px; }
.card .h2 { font-family: var(--font-title); font-weight: 800; color: var(--navy); font-size: clamp(1.25rem, 3vw, 1.6rem); margin: 0 0 10px; }
.eyebrow { font-family: var(--font-ui); font-weight: 600; font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--granate); margin: 0; }
.lead { font-size: 1.04rem; color: #314558; margin: 0 auto 14px; max-width: 46ch; }
.muted { color: var(--muted); font-size: .92rem; margin: 0 auto 22px; max-width: 48ch; }

/* Alerta "caíste" */
.card-alert { border-top: 5px solid var(--granate); }
.alert-badge {
  width: 66px; height: 66px; margin: 0 auto 10px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--granate), var(--granate-600));
  border-radius: 18px;
  box-shadow: 0 12px 26px -12px rgba(125, 14, 15, .7);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-ui); font-weight: 600; font-size: .96rem;
  text-decoration: none; cursor: pointer;
  padding: 13px 26px; border-radius: 999px; border: 0;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.btn-lg { padding: 15px 30px; font-size: 1rem; }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(4px); }
.btn-primary { background: linear-gradient(135deg, var(--granate), var(--granate-600)); color: #fff; box-shadow: 0 14px 30px -12px rgba(125, 14, 15, .65); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 20px 38px -14px rgba(125, 14, 15, .7); }
.btn-ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--navy); background: #f6f9fd; }
.btn-ms { background: var(--navy); color: #fff; box-shadow: var(--shadow-md); }
.btn-ms:hover { transform: translateY(-2px); background: var(--navy-700); }
.ms-logo { display: inline-grid; grid-template-columns: 9px 9px; grid-gap: 2px; }
.ms-logo i { width: 9px; height: 9px; display: block; }
.ms-logo i:nth-child(1) { background: #f25022; }
.ms-logo i:nth-child(2) { background: #7fba00; }
.ms-logo i:nth-child(3) { background: #00a4ef; }
.ms-logo i:nth-child(4) { background: #ffb900; }

/* ---------- Formularios ---------- */
.form { display: grid; gap: 16px; text-align: left; margin-top: 8px; }
.field { display: grid; gap: 6px; }
.field span { font-family: var(--font-ui); font-weight: 600; font-size: .82rem; color: var(--navy); }
.field input {
  font-family: var(--font-body); font-size: 1rem; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fbfcfe;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus { outline: 0; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(1, 50, 92, .12); }
.form .btn { justify-self: start; margin-top: 4px; }
.pill-note { font-family: var(--font-ui); font-size: .78rem; color: var(--warn); background: var(--warn-bg); border: 1px solid #f3d9bf; padding: 8px 14px; border-radius: 999px; display: inline-block; margin: 0 0 6px; }

/* ---------- Contenido ancho (módulo / reporte) ---------- */
.wrap { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: clamp(28px, 5vw, 52px) 20px 64px; }
.module-head { text-align: center; margin-bottom: 30px; }
.module-head h1 { font-family: var(--font-title); font-weight: 800; color: var(--navy); font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 8px 0 10px; letter-spacing: -.5px; }

/* Video uniforme */
.video-card { background: var(--navy-950); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow-lg); }
.video-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Puntos clave */
.keypoints { margin: 40px 0; }
.keypoints h2, .quiz h2 { font-family: var(--font-title); font-weight: 800; color: var(--navy); font-size: 1.35rem; margin: 0 0 16px; }
.kp-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.kp-list li { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: var(--radius-sm); padding: 14px 18px; box-shadow: var(--shadow-md); }
.kp-check { flex: none; width: 26px; height: 26px; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); border-radius: 8px; font-weight: 700; margin-top: 1px; }

/* ---------- Quiz ---------- */
.quiz { margin-top: 44px; }
.quiz-form { display: grid; gap: 20px; margin-top: 10px; }
.q { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin: 0; background: var(--card); box-shadow: var(--shadow-md); }
.q legend { display: flex; gap: 12px; align-items: flex-start; font-family: var(--font-ui); font-weight: 600; color: var(--navy); font-size: 1.04rem; padding: 0; }
.qn { flex: none; width: 28px; height: 28px; display: grid; place-items: center; background: var(--navy); color: #fff; border-radius: 8px; font-size: .9rem; }
.opts { display: grid; gap: 10px; margin-top: 16px; }
.opt { display: flex; align-items: center; gap: 13px; padding: 13px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s, background .15s, transform .1s; background: #fbfcfe; }
.opt:hover { border-color: var(--navy-700); background: #f4f8fc; }
.opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.opt-box { flex: none; width: 20px; height: 20px; border: 2px solid #b9c6d4; border-radius: 50%; display: grid; place-items: center; transition: border-color .15s; }
.opt-box::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--granate); transform: scale(0); transition: transform .15s; }
.opt input:checked + .opt-box { border-color: var(--granate); }
.opt input:checked + .opt-box::after { transform: scale(1); }
.opt input:focus-visible + .opt-box { box-shadow: 0 0 0 4px rgba(1, 50, 92, .15); }
.opt:has(input:checked) { border-color: var(--granate); background: #fdf3f3; }
.opt-text { font-size: .98rem; }

/* ---------- Resultado ---------- */
.card-result { border-top: 5px solid var(--navy); }
.card-result.is-pass { border-top-color: var(--ok); }
.card-result.is-fail { border-top-color: var(--warn); }
.result-badge { width: 72px; height: 72px; margin: 0 auto 8px; display: grid; place-items: center; border-radius: 50%; font-size: 2rem; color: #fff; }
.is-pass .result-badge { background: linear-gradient(145deg, #23a05f, var(--ok)); box-shadow: 0 14px 30px -12px rgba(26, 127, 75, .7); }
.is-fail .result-badge { background: linear-gradient(145deg, #d9802f, var(--warn)); box-shadow: 0 14px 30px -12px rgba(180, 83, 12, .6); }
.score { font-family: var(--font-ui); font-size: 1.1rem; color: var(--navy); margin: 4px 0 22px; }
.score strong { font-size: 1.3rem; }
.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Certificado ---------- */
.cert-wrap { display: grid; place-items: center; gap: 22px; }
.cert { width: 100%; max-width: 760px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 14px; }
.cert-inner {
  border: 2px solid var(--navy); border-radius: 12px; padding: clamp(26px, 5vw, 54px); text-align: center;
  background:
    radial-gradient(600px 300px at 50% -40%, rgba(1, 50, 92, .05), transparent 70%),
    repeating-linear-gradient(135deg, rgba(1, 50, 92, .02) 0 10px, transparent 10px 20px);
}
.cert-mark { margin-bottom: 10px; }
.cert-kicker { font-family: var(--font-ui); font-weight: 600; letter-spacing: .16em; text-transform: uppercase; font-size: .7rem; color: var(--granate); margin: 0; }
.cert-title { font-family: var(--font-title); font-weight: 800; color: var(--navy); font-size: clamp(1.6rem, 4vw, 2.3rem); margin: 8px 0 20px; letter-spacing: -.5px; }
.cert-awarded { font-family: var(--font-ui); color: var(--muted); font-size: .86rem; text-transform: uppercase; letter-spacing: .14em; margin: 0; }
.cert-name { font-family: var(--font-title); font-weight: 800; color: var(--ink); font-size: clamp(1.4rem, 4vw, 2rem); margin: 6px 0 16px; border-bottom: 2px solid var(--line); display: inline-block; padding: 0 20px 10px; }
.cert-body { color: #314558; max-width: 44ch; margin: 0 auto 26px; }
.cert-body strong { color: var(--navy); }
.cert-foot { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); padding-top: 20px; flex-wrap: wrap; }
.cf-item { display: flex; flex-direction: column; font-family: var(--font-ui); text-align: left; }
.cf-item span { font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.cf-item strong { color: var(--navy); font-size: .98rem; }
.cert-seal { width: 88px; height: 88px; transform: rotate(-7deg); opacity: .92; }
.cert-actions { display: flex; gap: 12px; }

/* ---------- Reporte ---------- */
.stats { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 18px; box-shadow: var(--shadow-md); }
.stat strong { display: block; font-family: var(--font-ui); color: var(--navy); }
.stat span { font-size: .85rem; color: var(--muted); }
.tbl-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.tbl { width: 100%; border-collapse: collapse; background: #fff; font-size: .86rem; }
.tbl th, .tbl td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th { font-family: var(--font-ui); font-weight: 600; color: #fff; background: var(--navy); position: sticky; top: 0; }
.tbl tr:nth-child(even) td { background: #f7f9fc; }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 20px; font-size: .78rem; color: var(--muted); background: var(--paper); border-top: 1px solid var(--line); }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .brand-text small { display: none; }
  .btn { width: 100%; }
  .form .btn { justify-self: stretch; }
  .cert-foot { justify-content: center; }
}

/* ---------- Impresión (certificado) ---------- */
@media print {
  .topbar, .footer, .cert-actions, .no-print { display: none !important; }
  body { background: #fff; }
  .wrap { padding: 0; }
  .cert { box-shadow: none; max-width: 100%; }
  .cert-inner { border-color: #01325C; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
