:root {
  --bg: #f4efe4;
  --paper: #fffaf0;
  --ink: #13261b;
  --muted: #5e665e;
  --line: rgba(19, 38, 27, 0.12);
  --brand: #0f6b46;
  --brand-2: #d56a2d;
  --brand-3: #e6d3a5;
  --deep: #173629;
  --shadow: 0 18px 50px rgba(19, 38, 27, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(213, 106, 45, 0.14), transparent 30%),
    radial-gradient(circle at top right, rgba(15, 107, 70, 0.18), transparent 28%),
    linear-gradient(180deg, #fbf5e8 0%, var(--bg) 48%, #efe7d7 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.site-shell,
.verify-shell,
.issue-shell,
.certificate-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 22px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-badge {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), #1f8f5f);
  color: white;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.brand strong,
.hero h1,
.section-heading h2,
.verify-panel h1,
.issue-form h1,
.certificate-card h2 {
  font-family: "Merriweather", Georgia, serif;
}

.brand small {
  display: block;
  color: var(--muted);
}

.topnav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.topnav a {
  color: var(--muted);
  font-weight: 500;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  padding: 20px 0 40px;
  align-items: stretch;
}

.hero-copy,
.hero-panel,
.verify-panel,
.issue-form,
.certificate-preview,
.split-card,
.step-card {
  background: rgba(255, 250, 240, 0.82);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.hero-copy {
  border-radius: 32px;
  padding: 42px;
}

.hero h1 {
  font-size: clamp(2.3rem, 4vw, 4.2rem);
  line-height: 1.03;
  margin: 0 0 16px;
}

.hero-text,
.section-heading p,
.panel-card p,
.step-card p,
.split-card p,
.verify-result,
.json-panel textarea,
.feature-list li {
  color: var(--muted);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--brand);
}

.hero-actions,
.verify-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 26px 0 18px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 14px 22px;
  border: 1px solid var(--line);
  font-weight: 700;
}

.button-primary {
  background: linear-gradient(135deg, var(--brand), #167a52);
  color: white;
  border-color: transparent;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.72);
}

.hero-points,
.feature-list {
  padding-left: 18px;
  margin: 0;
  display: grid;
  gap: 8px;
}

.hero-panel {
  border-radius: 32px;
  padding: 22px;
  display: grid;
  gap: 16px;
}

.panel-card {
  border-radius: 24px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.panel-accent {
  background: linear-gradient(180deg, #214535, var(--deep));
  color: white;
}

.panel-accent p,
.panel-accent .panel-label {
  color: rgba(255, 255, 255, 0.82);
}

.section {
  padding: 36px 0 20px;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 22px;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.filter {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
}

.filter.is-active {
  background: var(--ink);
  color: white;
}

.course-grid,
.steps,
.split {
  display: grid;
  gap: 18px;
}

.course-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.course-card {
  border-radius: 28px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}

.course-card h3 {
  margin: 0;
  font-size: 1.26rem;
}

.course-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(213, 106, 45, 0.14);
  color: #8d4b1e;
  font-size: 0.88rem;
  font-weight: 700;
}

.steps {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.step-card {
  border-radius: 24px;
  padding: 22px;
}

.step-card span {
  display: inline-flex;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--brand-3);
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 12px;
}

.split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-bottom: 60px;
}

.split-card {
  border-radius: 28px;
  padding: 28px;
}

.split-card.darker {
  background: linear-gradient(180deg, #f2dcc4, #f0c89f);
}

.cta-box {
  margin-top: 20px;
  border-radius: 20px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.verify-shell,
.issue-shell,
.certificate-shell {
  padding: 32px 0 48px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 16px;
  color: var(--muted);
}

.verify-panel,
.issue-layout {
  border-radius: 30px;
}

.verify-panel {
  padding: 34px;
}

.verify-form label,
.issue-form label {
  display: grid;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 14px;
}

input,
textarea {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  padding: 14px 16px;
  font: inherit;
}

.verify-result {
  margin-top: 22px;
  border-radius: 24px;
  border: 1px dashed var(--line);
  padding: 24px;
  background: rgba(255, 255, 255, 0.48);
}

.verify-result.success {
  border-style: solid;
  background: rgba(15, 107, 70, 0.08);
}

.verify-result.error {
  border-style: solid;
  background: rgba(213, 106, 45, 0.08);
}

.mono {
  font-family: Consolas, monospace;
  word-break: break-all;
}

.issue-layout {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 18px;
}

.issue-form,
.certificate-preview {
  border-radius: 30px;
  padding: 28px;
}

.certificate-card {
  border-radius: 24px;
  background: linear-gradient(135deg, #173629, #24513e);
  color: white;
  padding: 26px;
  margin-bottom: 18px;
}

.certificate-card p {
  margin: 8px 0;
}

.qr-panel,
.json-panel {
  border-radius: 24px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line);
  margin-top: 16px;
}

#qr-canvas canvas,
#qr-canvas img {
  max-width: 220px;
  width: 100%;
  height: auto;
}

.certificate-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.certificate-sheet {
  background: #f6eddb;
  border-radius: 32px;
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(92, 67, 17, 0.14);
}

.certificate-border {
  min-height: 1120px;
  padding: 48px 56px;
  border: 10px solid #caa75a;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(213, 106, 45, 0.12), transparent 28%),
    radial-gradient(circle at bottom left, rgba(15, 107, 70, 0.12), transparent 30%),
    linear-gradient(180deg, #fffdf7 0%, #fff7e8 100%);
  position: relative;
  overflow: hidden;
}

.certificate-border::before,
.certificate-border::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(202, 167, 90, 0.55);
  border-radius: 18px;
  pointer-events: none;
}

.certificate-border::after {
  inset: auto 0 36px 0;
  margin: 0 auto;
  width: 380px;
  height: 380px;
  border-radius: 999px;
  border: 0;
  background: radial-gradient(circle, rgba(202, 167, 90, 0.08) 0%, rgba(202, 167, 90, 0.02) 42%, transparent 70%);
}

.certificate-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.certificate-header h1,
.certificate-student {
  font-family: "Cinzel", "Merriweather", Georgia, serif;
}

.certificate-header h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3rem);
}

.certificate-mark {
  width: 96px;
  height: 96px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-family: "Cinzel", serif;
  font-size: 2rem;
  font-weight: 700;
  color: #7c5314;
  background: radial-gradient(circle, #fffaf0 0%, #ead29c 100%);
  border: 3px solid #caa75a;
}

.certificate-intro {
  margin-top: 70px;
  text-align: center;
  font-size: 1.15rem;
  color: var(--muted);
}

.certificate-student {
  margin: 16px 0 10px;
  text-align: center;
  font-size: clamp(2rem, 4vw, 3.4rem);
  color: #7c5314;
}

.certificate-dni,
.certificate-body {
  text-align: center;
}

.certificate-dni {
  margin: 0 0 26px;
  font-size: 1.05rem;
  color: var(--muted);
}

.certificate-body {
  max-width: 820px;
  margin: 0 auto;
  font-size: 1.12rem;
  line-height: 1.8;
}

.certificate-body strong {
  color: #7c5314;
}

.certificate-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 46px;
}

.detail-card {
  border-radius: 20px;
  padding: 18px;
  border: 1px solid rgba(92, 67, 17, 0.18);
  background: rgba(255, 255, 255, 0.72);
}

.detail-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.certificate-footer {
  margin-top: 90px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

.signature-block {
  min-width: 280px;
  text-align: center;
}

.signature-line {
  width: 100%;
  border-top: 2px solid rgba(19, 38, 27, 0.45);
  margin-bottom: 10px;
}

.signature-block p,
.signature-block small {
  margin: 0;
}

.certificate-qr {
  max-width: 260px;
  text-align: center;
}

.certificate-qr #certificate-qr canvas {
  max-width: 160px;
  width: 100%;
  height: auto;
}

@media (max-width: 980px) {
  .hero,
  .split,
  .issue-layout,
  .certificate-details {
    grid-template-columns: 1fr;
  }

  .course-grid,
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .site-shell,
  .verify-shell,
  .issue-shell,
  .certificate-shell {
    width: min(100% - 20px, 1180px);
  }

  .hero-copy,
  .hero-panel,
  .verify-panel,
  .issue-form,
  .certificate-preview,
  .split-card {
    padding: 22px;
    border-radius: 24px;
  }

  .course-grid,
  .steps {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 2.3rem;
  }

  .certificate-toolbar,
  .certificate-footer,
  .certificate-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .certificate-border {
    padding: 28px 20px;
    min-height: auto;
  }
}

@media print {
  body.page-certificate {
    background: white;
  }

  .no-print {
    display: none !important;
  }

  .certificate-shell {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .certificate-sheet {
    box-shadow: none;
    border: 0;
    border-radius: 0;
    padding: 0;
  }

  .certificate-border {
    min-height: auto;
    border-radius: 0;
  }
}
