:root {
  --bg: #eef5f1;
  --paper: #fffdf6;
  --ink: #142421;
  --muted: #5c6b67;
  --line: rgba(20, 36, 33, 0.14);
  --brand: #116a5c;
  --brand-2: #b98b2f;
  --deep: #0f302b;
  --danger: #9b2d2d;
  --ok: #0e6f43;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #f8fbf8 0%, var(--bg) 100%);
}

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

.topbar,
main,
.footer,
.verify-shell,
.certificate-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

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

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

.brand-mark,
.certificate-seal {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--brand);
  color: white;
  font-weight: 800;
}

.brand small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-weight: 700;
}

.hero {
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 24px;
  align-items: stretch;
  padding: 24px 0 42px;
}

.hero-copy,
.hero-card,
.program-card,
.info-panel,
.verify-panel {
  border: 1px solid var(--line);
  background: rgba(255, 253, 246, 0.9);
  box-shadow: 0 18px 45px rgba(17, 106, 92, 0.1);
}

.hero-copy {
  padding: clamp(28px, 5vw, 58px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero h1 {
  max-width: 820px;
  margin: 0 0 18px;
  font-size: clamp(2.2rem, 5vw, 4.7rem);
  line-height: 1.02;
}

.hero p,
.section-head p,
.program-card p,
.info-panel p,
.footer,
.verify-result {
  color: var(--muted);
  line-height: 1.62;
}

.hero-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(160deg, var(--deep), #17483f);
  color: white;
}

.hero-card p,
.hero-card span,
.dark p {
  color: rgba(255, 255, 255, 0.82);
}

.hero-card span {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.hero-card h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--brand);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
}

.actions,
.verify-row,
.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.actions {
  margin-top: 26px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  padding: 13px 18px;
  min-height: 46px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.primary {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.secondary {
  background: white;
  color: var(--ink);
}

.section {
  padding: 36px 0;
}

.section-head {
  max-width: 740px;
  margin-bottom: 18px;
}

.section h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.08;
}

.program-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 24px;
  padding: 28px;
}

.program-card h3,
.info-panel h2 {
  margin-top: 0;
}

.program-card ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.info-panel {
  padding: 28px;
}

.dark {
  background: var(--deep);
  color: white;
}

.footer {
  padding: 26px 0 40px;
  font-size: 0.92rem;
}

.simple-page,
.certificate-page {
  min-height: 100vh;
}

.verify-shell,
.certificate-shell {
  padding: 28px 0;
}

.back-link {
  color: var(--brand);
  font-weight: 800;
}

.verify-panel {
  margin-top: 18px;
  padding: 28px;
  max-width: 820px;
}

.verify-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

.verify-row input {
  flex: 1;
  min-width: 220px;
  min-height: 46px;
  border: 1px solid var(--line);
  padding: 0 12px;
  border-radius: 8px;
  font-size: 1rem;
}

.verify-result {
  margin-top: 20px;
  border: 1px solid var(--line);
  padding: 18px;
  background: white;
}

.verify-result.success {
  border-left: 6px solid var(--ok);
}

.verify-result.error {
  border-left: 6px solid var(--danger);
}

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

.toolbar {
  justify-content: space-between;
  margin-bottom: 18px;
}

.certificate-sheet {
  background: #dfe8e4;
  padding: 22px;
}

.certificate-border {
  max-width: 1100px;
  min-height: 740px;
  margin: 0 auto;
  padding: 48px;
  background: var(--paper);
  border: 14px solid #e2d2a5;
  outline: 2px solid var(--brand);
}

.certificate-header,
.certificate-footer,
.certificate-details {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: center;
}

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

.certificate-seal {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: var(--deep);
  font-size: 1.6rem;
}

.certificate-intro {
  margin: 54px 0 8px;
  text-align: center;
  color: var(--muted);
}

#sheet-student {
  text-align: center;
  font-size: clamp(2rem, 4vw, 3.4rem);
  margin: 0;
}

.dni {
  text-align: center;
  font-weight: 800;
  color: var(--brand);
}

.certificate-body {
  max-width: 880px;
  margin: 28px auto 12px;
  text-align: center;
  color: #374541;
  font-size: 1.12rem;
  line-height: 1.7;
}

.certificate-subtitle {
  max-width: 820px;
  margin: 18px auto 28px;
  text-align: center;
  font-size: 1.24rem;
  font-weight: 800;
  color: var(--deep);
}

.certificate-details {
  border: 1px solid var(--line);
  padding: 16px;
  background: white;
}

.certificate-details div {
  display: grid;
  gap: 4px;
}

.certificate-details span {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  font-weight: 800;
}

.certificate-footer {
  margin-top: 50px;
  align-items: flex-end;
}

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

.signature-line {
  border-top: 2px solid var(--ink);
  margin-bottom: 10px;
}

.signature p {
  margin: 0;
  font-weight: 800;
}

.signature small {
  color: var(--muted);
}

.qr-box {
  display: grid;
  justify-items: center;
  gap: 8px;
  max-width: 240px;
  text-align: center;
  font-size: 0.72rem;
  word-break: break-all;
}

@media (max-width: 820px) {
  .topbar,
  .hero,
  .program-card,
  .grid-2,
  .certificate-header,
  .certificate-footer,
  .certificate-details {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .hero {
    min-height: auto;
  }

  .certificate-border {
    padding: 26px;
    border-width: 8px;
  }
}

@media print {
  body {
    background: white;
  }

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

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

  .certificate-border {
    border: 10px solid #d5c18b;
    outline: 1px solid #12332a;
    min-height: 100vh;
    box-shadow: none;
  }
}
