/* Brújula Exportadora — CSS idéntico a diagnostico-aglV2.html */

:root {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);

  --ink: #0c211f;
  --teal-900: #063836;
  --teal-800: #08514e;
  --teal-700: #099595;
  --teal-500: #2fb4ac;
  --teal-200: #bfe4de;
  --paper: #f3efe1;
  --paper-card: #fbf9f1;
  --line: #d9cfab;
  --line-soft: #e7e0c8;
  --gold: #b9852f;
  --gold-soft: #e7c988;
  --muted: #5c6e68;
  --danger: #a3432b;

  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #eef2ef;
    --paper: #0a1e1c;
    --paper-card: #0f2624;
    --line: #234542;
    --line-soft: #1a3432;
    --muted: #9db3ad;
    --teal-200: #17403c;
  }
}
:root[data-theme="dark"] {
  --ink: #eef2ef;
  --paper: #0a1e1c;
  --paper-card: #0f2624;
  --line: #234542;
  --line-soft: #1a3432;
  --muted: #9db3ad;
  --teal-200: #17403c;
}

html { scroll-padding-top: env(safe-area-inset-top, 0px); height: 100%; }
* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(9,149,149,0.07) 1px, transparent 0);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; }

.shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px calc(60px + env(safe-area-inset-bottom, 0px));
}

/* ---------- Header / letterhead ---------- */
header.letterhead {
  background: linear-gradient(155deg, var(--teal-900), var(--teal-700) 130%);
  border-radius: 14px;
  padding: 30px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 0 rgba(0,0,0,0.05);
}
header.letterhead img {
  height: 54px;
  width: auto;
  display: block;
}

/* ---------- Card ---------- */
main.card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-top: 16px;
  padding: 34px 30px;
  position: relative;
  overflow: hidden;
}
main.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 3px solid var(--teal-700);
  pointer-events: none;
}

@media (max-width: 560px) {
  main.card { padding: 26px 18px; }
  header.letterhead { padding: 22px 16px; }
  header.letterhead img { height: 42px; }
}

/* ---------- Intro ---------- */
.intro-eyebrow {
  font-size: 13px;
  color: var(--teal-700);
  font-weight: 600;
  margin: 0 0 10px;
}
h1.intro-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.12;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
p.intro-lead {
  font-size: 16px;
  color: var(--muted);
  max-width: 46ch;
  margin: 0 0 26px;
}
.intro-list {
  list-style: none;
  margin: 0 0 30px;
  padding: 0;
  display: grid;
  gap: 9px;
}
.intro-list li {
  font-size: 14.5px;
  color: var(--ink);
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.intro-list li::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  flex: none;
  transform: translateY(-2px);
}

/* ---------- Step chrome ---------- */
.step-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
}
.step-num {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  color: var(--teal-700);
  border: 1px solid var(--teal-700);
  border-radius: 999px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.step-track {
  flex: 1;
  height: 3px;
  background: var(--line-soft);
  border-radius: 2px;
  overflow: hidden;
}
.step-track > div {
  height: 100%;
  background: var(--teal-700);
  border-radius: 2px;
  transition: width 0.35s ease;
}

h2.question {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(21px, 3.4vw, 26px);
  line-height: 1.25;
  margin: 0 0 22px;
  max-width: 30ch;
}

.field { margin-bottom: 8px; }
.field label.field-label {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 8px;
}

input[type="text"] {
  width: 100%;
  font-family: var(--font-body);
  font-size: 17px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  outline: none;
}
input[type="text"]:focus-visible {
  border-color: var(--teal-700);
  box-shadow: 0 0 0 3px rgba(9,149,149,0.18);
}

.options {
  display: grid;
  gap: 10px;
}
.opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  cursor: pointer;
  font-size: 15px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.opt:hover { border-color: var(--teal-500); }
.opt input { margin-top: 3px; accent-color: var(--teal-700); flex: none; }
.opt.checked {
  border-color: var(--teal-700);
  background: color-mix(in srgb, var(--teal-700) 8%, var(--paper));
}
.opt .opt-text strong { display: block; font-weight: 600; }
.opt .opt-text span { color: var(--muted); font-size: 13px; }

.opt:focus-within { border-color: var(--teal-700); box-shadow: 0 0 0 3px rgba(9,149,149,0.18); }

/* ---------- Nav buttons ---------- */
.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
  gap: 12px;
}
button {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  border-radius: 8px;
  padding: 12px 22px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity 0.15s ease, transform 0.05s ease;
}
button:active { transform: translateY(1px); }
button.primary {
  background: var(--teal-700);
  color: #fff;
  border-color: var(--teal-700);
}
button.primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button.ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}
button.ghost:hover { color: var(--ink); border-color: var(--muted); }
button:focus-visible { outline: 2px solid var(--teal-700); outline-offset: 2px; }

/* ---------- Results ---------- */
.result-eyebrow {
  text-align: center;
  font-size: 13px;
  color: var(--teal-700);
  font-weight: 600;
  margin: 0 0 6px;
}
h1.result-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(26px, 4.6vw, 34px);
  text-align: center;
  margin: 0 0 22px;
  line-height: 1.18;
}
p.result-summary {
  font-size: 15.5px;
  color: var(--ink);
  background: var(--teal-200);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 0 0 28px;
}

.bars {
  margin: 0 0 30px;
  display: grid;
  gap: 10px;
}
.bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 34px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.bar-row .bar-label { color: var(--muted); }
.bar-row .bar-label.active { color: var(--ink); font-weight: 600; }
.bar-track {
  height: 8px;
  background: var(--line-soft);
  border-radius: 5px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal-500), var(--teal-700));
  border-radius: 5px;
  width: 0%;
  transition: width 0.5s ease;
}
.bar-row .bar-val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

h3.section-title {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.course-list { display: grid; gap: 12px; margin-bottom: 28px; }
.course-row {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.course-idx {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--teal-700);
  font-size: 15px;
  flex: none;
  width: 22px;
}
.course-body strong { display: block; font-size: 15.5px; margin-bottom: 4px; }
.course-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--teal-200);
  color: var(--teal-900);
  font-weight: 600;
  letter-spacing: 0.01em;
}
:root[data-theme="dark"] .tag,
@media (prefers-color-scheme: dark) { .tag { color: var(--teal-200); background: var(--teal-800); } }
.course-why { font-size: 13.5px; color: var(--muted); margin: 0; }

.result-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

footer.foot {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 22px;
}

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ===== Agregado del plugin (no altera el diseño original) ===== */

/* Campo trampa anti-bots: invisible para las personas */
.brujula-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0; }
