/* ===========================
   LOOP ENGINEERING — ESTILOS
   Sistema light · Ascanio.IA
   =========================== */

:root {
  --bg: #f5f5f3;
  --bg-card: #ffffff;
  --bg-alt: #eeeee9;
  --text: #1a1a1a;
  --text-dim: #4a4a4a;
  --text-muted: #888;
  --border: #e0e0dc;
  --border-strong: #c8c8c2;
  --accent: #14b8a6;
  --accent-dark: #0d9488;
  --purple: #7c3aed;
  --orange: #ea580c;
  --red: #ef4444;
  --green: #16a34a;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
}

/* LAYOUT */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 720px; }
.text-center { text-align: center; }

/* SECTION */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }

.section-tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.section h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.section-sub {
  font-size: 18px;
  color: var(--text-dim);
  margin-bottom: 40px;
  max-width: 580px;
}

/* HERO */
.hero {
  background: linear-gradient(135deg, #ffffff, #f0efeb);
  padding: 100px 24px 90px;
  text-align: center;
}

.hero-tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(56px, 10vw, 96px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 24px;
}

.hero h1 .accent {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: 20px;
  color: var(--text-dim);
  max-width: 520px;
  margin: 0 auto 36px;
  line-height: 1.5;
}

/* BUTTONS */
.btn-primary {
  display: inline-block;
  background: var(--text);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-primary:hover { background: #333; }

/* TYPOGRAPHY */
.lead {
  font-size: 19px;
  line-height: 1.7;
  color: var(--text-dim);
  margin-bottom: 20px;
}

p { margin-bottom: 16px; color: var(--text-dim); }
p:last-child { margin-bottom: 0; }

strong { color: var(--text); }

.note {
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  margin-top: 12px;
}

.callout {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 20px 24px;
  font-size: 17px;
  color: var(--text);
  margin-top: 36px;
  font-style: italic;
}

/* TEST CHECKLIST */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.check-item:hover { border-color: var(--accent); }
.check-item.checked { border-color: var(--accent); background: #f0fdfb; }

.check-item input[type="checkbox"] { display: none; }

.check-box {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-strong);
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.check-item.checked .check-box {
  background: var(--accent);
  border-color: var(--accent);
}

.check-item.checked .check-box::after {
  content: '✓';
  color: white;
  font-size: 13px;
  font-weight: 700;
}

.check-text strong {
  display: block;
  font-size: 15px;
  margin-bottom: 3px;
}

.check-text em {
  font-size: 13px;
  color: var(--text-muted);
  font-style: normal;
}

/* TEST RESULT */
.test-result {
  min-height: 56px;
  padding: 18px 22px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}

.result-none { background: transparent; color: transparent; }

.result-low {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.result-mid {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.result-high {
  background: #f0fdf9;
  border: 1px solid #99f6e4;
  color: #065f46;
}

/* PIECES GRID */
.pieces-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.piece {
  display: flex;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.piece-required { border-left: 4px solid var(--accent); }
.piece-safety { border-left: 4px solid var(--purple); }

.piece-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--border-strong);
  line-height: 1;
  flex-shrink: 0;
  width: 40px;
  font-variant-numeric: tabular-nums;
}

.piece-body { flex: 1; }

.piece-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.piece-label.required { color: var(--accent); }
.piece-label.safety { color: var(--purple); }

.piece h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}

.example-block {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.example-bad, .example-good {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-style: italic;
}

.example-bad { background: #fef2f2; color: #b91c1c; }
.example-good { background: #f0fdf9; color: #065f46; }

.cycle-list {
  padding-left: 20px;
  margin-top: 10px;
}

.cycle-list li { margin-bottom: 6px; font-size: 14px; color: var(--text-dim); }

.eval-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.eval-examples span {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 13px;
  color: var(--text-dim);
}

.feedback-list {
  padding-left: 0;
  list-style: none;
  margin-top: 10px;
}

.feedback-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-dim);
}

.feedback-list li:last-child { border-bottom: none; }

/* TEMPLATE */
.template-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: var(--font);
}

.copy-btn:hover { background: #333; }

#template-text {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  padding: 28px 24px;
  color: var(--text-dim);
  white-space: pre-wrap;
  overflow-x: auto;
}

/* EXAMPLE LOOP */
.example-loop {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.el-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.el-row:last-child { border-bottom: none; }

.el-key {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-top: 2px;
}

.el-val { font-size: 14px; color: var(--text-dim); }
.el-val ol { padding-left: 18px; }
.el-val li { margin-bottom: 4px; }

/* GOOD/BAD TABLE */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.col-good h3, .col-bad h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
}

.col-good h3 { color: var(--green); }
.col-bad h3 { color: var(--red); }

.loop-table { display: flex; flex-direction: column; gap: 8px; }

.lt-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}

.lt-task {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.lt-why {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
}

/* ERRORS */
.errors-list { display: flex; flex-direction: column; gap: 16px; }

.error-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 20px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.error-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--border-strong);
  flex-shrink: 0;
  width: 36px;
  line-height: 1;
  margin-top: 2px;
}

.error-item strong { font-size: 15px; display: block; margin-bottom: 6px; }

/* MVL STEPS */
.mvl-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.mvl-step {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  font-size: 16px;
  color: var(--text-dim);
}

.mvl-n {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* CTA */
.cta-section { background: var(--text); }
.cta-section .section-tag { color: var(--accent); }
.cta-section h2 { color: #fff; }
.cta-section p { color: #aaa; }

.cta-template {
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 10px;
  padding: 24px;
  margin: 24px 0;
  text-align: left;
}

.cta-template pre {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #ccc;
  line-height: 1.7;
  white-space: pre-wrap;
}

.cta-note {
  font-size: 18px;
  color: #aaa;
  font-style: italic;
  margin-bottom: 28px !important;
}

.author-note {
  margin-top: 16px;
  font-size: 13px;
  color: #555 !important;
}

/* RESPONSIVE */
@media (max-width: 640px) {
  .hero { padding: 60px 20px; }
  .section { padding: 56px 0; }
  .two-col { grid-template-columns: 1fr; }
  .piece { flex-direction: column; gap: 12px; }
  .piece-num { font-size: 20px; width: auto; }
  .el-row { grid-template-columns: 1fr; gap: 6px; }
  .el-key { font-size: 11px; }
}
