:root {
  --red:        #BF0000;
  --red-dark:   #990000;
  --red-dim:    rgba(191,0,0,0.08);
  --grey:       #626A6F;
  --grey-light: #e8eaeb;
  --grey-text:  #626A6F;
  --navy:       #1a1a1a;
  --white:      #ffffff;
  --off-white:  #f5f5f5;
  --border:     #d8d8d8;
  --font-main:  'Barlow', sans-serif;
  --font-cond:  'Barlow Condensed', sans-serif;
  --header-h:   72px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
[id] { scroll-margin-top: calc(var(--header-h) + 20px); }

body {
  background: var(--off-white);
  color: var(--navy);
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.65;
}

/* HEADER */
header {
  height: var(--header-h);
  background: #bf0000;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.header-left { display: flex; align-items: center; gap: 1.5rem; }

.logo-slot {
  height: 46px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-slot img { max-height: 46px; max-width: 46px; }

.logo-slot a {
    height: 46px;
}

.hdivider { width: 1px; height: 30px; background: rgba(255,255,255,0.6); }

.header-title h1 {
  font-family: var(--font-cond);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.header-title p {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.80);
  font-weight: 300;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.8);
  font-family: var(--font-cond);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.15s;
}

.back-link:hover { color: var(--white); }
.back-link svg { width: 14px; height: 14px; }

/* HERO */
.hero {
  background: linear-gradient(135deg, #111111 0%, #2a2a2a 100%);
  border-bottom: 4px solid var(--red);
  padding: 2.5rem 0;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2.5rem;
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.hero-icon {
  width: 46px;
  height: 46px;
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-icon svg { width: 26px; height: 26px; color: white; }

.hero-text h2 {
  font-family: var(--font-cond);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-text p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
  margin-top: 0.25rem;
  font-weight: 300;
}

/* MAIN */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2.5rem 7rem;
}

/* TOC */
.toc {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 4px solid var(--navy);
  margin-bottom: 3rem;
  padding: 1.75rem 2rem;
}

.toc-title {
  font-family: var(--font-cond);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--grey-text);
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.toc-grid { display: grid; gap: 0.75rem; }

.toc-item {
  display: block;
  text-decoration: none;
  background: var(--off-white);
  border: 1px solid var(--border);
  border-bottom: 3px solid var(--grey-light);
  padding: 1rem 1.1rem;
  transition: all 0.15s ease;
}

.toc-item:hover {
  border-bottom-color: var(--red);
  background: var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.toc-num {
  font-family: var(--font-cond);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--grey-light);
  line-height: 1;
  margin-bottom: 0.4rem;
  transition: color 0.15s;
}

.toc-item:hover .toc-num { color: var(--red); }
.toc-label { font-size: 0.82rem; font-weight: 600; color: var(--navy); line-height: 1.35; }
.toc-sub { font-size: 0.73rem; color: var(--grey-text); margin-top: 0.2rem; font-weight: 300; }

/* EXERCISE */
.exercise {
  background: var(--white);
  border: 1px solid var(--border);
  margin-bottom: 2rem;
  overflow: hidden;
}

.exercise-header {
  background: var(--navy);
  padding: 1.3rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.ex-left { display: flex; align-items: center; gap: 1rem; }

.ex-num {
  background: var(--red);
  color: var(--white);
  font-family: var(--font-cond);
  font-size: 1.05rem;
  font-weight: 700;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ex-title {
  font-family: var(--font-cond);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ex-subtitle {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.42);
  margin-top: 0.15rem;
  font-weight: 300;
}

.tool-badge {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.6);
  font-family: var(--font-cond);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  padding: 0.28rem 0.8rem;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.exercise-body { padding: 1.75rem; }

/* DOCS */
.docs-section { margin-bottom: 1.75rem; }

.docs-label {
  font-family: var(--font-cond);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--grey-text);
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}

.docs-grid { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.doc-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--off-white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--navy);
  padding: 0.65rem 1.1rem;
  text-decoration: none;
  color: var(--navy);
  font-size: 0.84rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.doc-link:hover { background: var(--navy); color: var(--white); border-left-color: var(--red); }
.doc-link svg { width: 14px; height: 14px; flex-shrink: 0; }
.doc-link.docx { border-left-color: #2b579a; }

/* PROMPT GROUP */
.prompt-group-label {
  font-family: var(--font-cond);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--grey-text);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  margin-top: 1.6rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.prompt-group-label.first { margin-top: 0; padding-top: 0; border-top: none; }

.pg-num {
  background: var(--red);
  color: white;
  font-family: var(--font-cond);
  font-size: 0.62rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* PROMPT BOX */
.prompt-item { margin-bottom: 0.65rem; }
.prompt-item:last-child { margin-bottom: 0; }

.prompt-box { border: 1px solid var(--border); background: var(--off-white); overflow: hidden; }

.prompt-text {
  padding: 1.1rem 1.3rem;
  font-size: 0.9rem;
  color: var(--navy);
  white-space: pre-wrap;
  line-height: 1.65;
  font-weight: 400;
}

.prompt-footer {
  border-top: 1px solid var(--border);
  padding: 0.5rem 1.1rem;
  display: flex;
  justify-content: flex-end;
  background: var(--white);
}

/* COPY BTN */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--grey-text);
  font-family: var(--font-cond);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase;
}

.copy-btn:hover { background: var(--navy); border-color: var(--navy); color: var(--white); }
.copy-btn.copied { background: var(--red); border-color: var(--red); color: var(--white); }
.copy-btn svg { width: 11px; height: 11px; }

/* INFO NOTE */
.info-note {
  background: #f2f2f2;
  border: 1px solid var(--border);
  border-left: 3px solid var(--grey);
  padding: 0.9rem 1.2rem 0.9rem 2.8rem;
  font-size: 0.86rem;
  color: #444;
  margin-bottom: 1.5rem;
  display: block;
  line-height: 1.6;
  position: relative;
}

.info-note svg {
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 14px;
  height: 14px;
  color: var(--grey);
}

/* VARIANT HEADER (Caso 2A / 2B) */
.variant-header {
  background: #f0f0f0;
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  padding: 0.65rem 1.1rem;
  font-family: var(--font-cond);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--red-dark);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}

.variant-header.first { margin-top: 0; }

/* INFO DATA */
.info-data {
  background: #f8f8f8;
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.86rem;
  color: #444;
  line-height: 1.7;
}

.info-data strong {
  font-family: var(--font-cond);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--grey);
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.4rem;
}

/* FOOTER */
footer {
  background: var(--navy);
  border-top: 4px solid var(--red);
  padding: 2rem 2.5rem;
  text-align: center;
}

footer p, footer a {
  font-size: 0.76rem;
  color: rgba(255,255,255,0.8);
  font-family: var(--font-cond);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 640px) {
  .header-inner, main { padding-left: 1.5rem; padding-right: 1.5rem; }
  .hero-inner { padding: 0 1.5rem; }
  .exercise-header { padding: 1rem 1.25rem; }
  .exercise-body { padding: 1.25rem; }
}
