:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #14233b;
  background: #f2f5f8;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 10% 0, rgba(23, 88, 151, 0.12), transparent 32rem),
    #f2f5f8;
}

a { color: inherit; }
button, input { font: inherit; }

.site-header {
  width: min(100% - 2rem, 74rem);
  min-height: 5.5rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #dce2e9;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-mark {
  width: 2.7rem;
  height: 2.7rem;
  display: grid;
  place-items: center;
  border-radius: 0.7rem;
  color: #fff;
  background: #173b67;
  font-family: Georgia, serif;
  font-size: 1.45rem;
  font-weight: 700;
}

.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: 0.11em; }
.brand small { margin-top: 0.08rem; color: #718096; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.09em; }

.system-pill, .secure-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #486075;
  font-size: 0.78rem;
  font-weight: 700;
}

.public-header-actions { display: flex; align-items: center; gap: 1.1rem; }
.issuer-link { color: #52657b; font-size: 0.76rem; font-weight: 700; text-decoration: none; }
.issuer-link:hover { color: #1c5e91; }

.system-pill i, .valid-badge i {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: #18885a;
  box-shadow: 0 0 0 0.25rem rgba(24, 136, 90, 0.12);
}

.secure-pill svg { width: 1rem; fill: none; stroke: currentColor; stroke-width: 1.7; }

.home-shell {
  width: min(100% - 2rem, 74rem);
  min-height: calc(100vh - 10rem);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(19rem, 0.75fr);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: center;
  padding: 4rem 0;
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: #266596;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1, .form-card h1, .message-card h1, .verified-header h1 {
  margin: 0;
  color: #10213b;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.045em;
}

.hero h1 { font-size: clamp(3rem, 7vw, 6.2rem); line-height: 0.93; }
.hero h1 em { color: #296c9d; font-weight: 400; }

.hero-copy {
  max-width: 35rem;
  margin: 1.8rem 0 2rem;
  color: #657387;
  font-size: 1.08rem;
  line-height: 1.7;
}

.scan-card {
  max-width: 36rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1.15rem;
  border: 1px solid #d9e1e9;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.8);
}

.scan-icon {
  flex: 0 0 auto;
  width: 3.2rem;
  height: 3.2rem;
  display: grid;
  place-items: center;
  border-radius: 0.85rem;
  color: #1c5e91;
  background: #e5f0f8;
}

.scan-icon svg { width: 1.65rem; fill: none; stroke: currentColor; stroke-width: 1.45; }
.scan-card strong, .scan-card span { display: block; }
.scan-card strong { margin-bottom: 0.2rem; }
.scan-card span { color: #6d7889; font-size: 0.88rem; line-height: 1.45; }

.registry-count { margin: 1.2rem 0 0; color: #7b8797; font-size: 0.78rem; }
.registry-count strong { color: #1c5e91; }

.process-card {
  padding: clamp(1.5rem, 4vw, 2.6rem);
  border-radius: 1.4rem;
  color: #fff;
  background: #132d4f;
  box-shadow: 0 1.6rem 3.5rem rgba(19, 45, 79, 0.2);
}

.process-card .eyebrow { color: #8ec6e8; }
.steps { margin: 0; padding: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 2.5rem 1fr; gap: 1rem; padding: 1.2rem 0; border-top: 1px solid rgba(255,255,255,0.12); }
.steps li > span { color: #78b9dd; font-family: Georgia, serif; font-size: 1rem; }
.steps strong { font-family: Georgia, serif; font-size: 1.22rem; font-weight: 500; }
.steps p { margin: 0.3rem 0 0; color: #aebed0; font-size: 0.87rem; line-height: 1.55; }

.site-footer { width: min(100% - 2rem, 74rem); margin: 0 auto; padding: 1.25rem 0; border-top: 1px solid #dce2e9; color: #8590a0; font-size: 0.72rem; text-align: center; }

.center-shell {
  width: min(100% - 2rem, 32rem);
  min-height: calc(100vh - 5.5rem);
  margin: 0 auto;
  display: grid;
  align-items: center;
  padding: 3rem 0 5rem;
}

.form-card, .message-card {
  padding: clamp(1.8rem, 7vw, 3.2rem);
  border: 1px solid #dce2e9;
  border-radius: 1.4rem;
  background: #fff;
  box-shadow: 0 1.5rem 4rem rgba(21, 42, 70, 0.1);
}

.form-icon, .message-icon {
  width: 3.5rem;
  height: 3.5rem;
  display: grid;
  place-items: center;
  margin-bottom: 1.6rem;
  border-radius: 50%;
  color: #187952;
  background: #e5f5ed;
}

.form-icon svg { width: 1.85rem; fill: currentColor; }
.form-card h1, .message-card h1 { font-size: clamp(2.2rem, 8vw, 3.5rem); line-height: 1; }
.form-copy, .message-card > p:not(.eyebrow) { margin: 1rem 0 2rem; color: #68778b; line-height: 1.6; }

label { display: block; margin-bottom: 0.55rem; color: #2b3d55; font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.input-wrap { display: flex; align-items: center; gap: 0.7rem; padding: 0 0.95rem; border: 1px solid #cbd5df; border-radius: 0.75rem; background: #fbfcfd; }
.input-wrap:focus-within { border-color: #296c9d; box-shadow: 0 0 0 0.23rem rgba(41,108,157,0.12); }
.input-wrap.input-error { border-color: #b94646; }
.input-wrap svg { width: 1.25rem; fill: none; stroke: #7a899b; stroke-width: 1.6; }
.input-wrap input { width: 100%; padding: 0.95rem 0; border: 0; outline: 0; color: #14233b; background: transparent; font-size: 1.12rem; letter-spacing: 0.12em; }
.field-help { display: block; margin-top: 0.45rem; color: #8290a0; font-size: 0.75rem; }
.alert { margin: 0.9rem 0 0; padding: 0.75rem 0.9rem; border-radius: 0.65rem; color: #8f2e2e; background: #fff0f0; font-size: 0.82rem; }

.primary-button {
  width: 100%;
  min-height: 3.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 1.4rem;
  padding: 0.8rem 1rem;
  border: 0;
  border-radius: 0.75rem;
  color: #fff;
  background: #173b67;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
.primary-button:hover { background: #0f2f56; }
.privacy-note { display: flex; justify-content: center; gap: 0.45rem; margin: 1.5rem 0 0; color: #8490a0; font-size: 0.72rem; }
.privacy-note svg { width: 0.9rem; fill: none; stroke: currentColor; stroke-width: 1.6; }

.results-shell { width: min(100% - 2rem, 68rem); margin: 0 auto; padding: 3.5rem 0 5rem; }
.verified-header { display: flex; gap: 1.3rem; align-items: center; padding-bottom: 2.5rem; border-bottom: 1px solid #dce2e9; }
.verified-icon { flex: 0 0 auto; width: 4.4rem; height: 4.4rem; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #197750; font-size: 1.7rem; }
.verified-header h1 { font-size: clamp(2.2rem, 6vw, 4.2rem); }
.verified-header > div > p:last-child { margin: 0.55rem 0 0; color: #748195; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin: 2.7rem 0 1.2rem; }
.section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 1.9rem; font-weight: 500; }
.section-heading > span { color: #7b8797; font-size: 0.75rem; }
.certificate-list { display: grid; gap: 0.85rem; }
.certificate-card { display: grid; grid-template-columns: auto 1fr auto; gap: 1.2rem; align-items: center; padding: 1.3rem; border: 1px solid #dce2e9; border-radius: 1rem; background: #fff; }
.document-icon { width: 3.2rem; height: 3.2rem; display: grid; place-items: center; border-radius: 0.75rem; color: #285f8c; background: #e8f1f7; }
.document-icon svg { width: 1.6rem; fill: none; stroke: currentColor; stroke-width: 1.55; }
.valid-badge { display: inline-flex; align-items: center; gap: 0.4rem; color: #18724e; font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.valid-badge i { width: 0.38rem; height: 0.38rem; box-shadow: none; }
.certificate-info h3 { margin: 0.35rem 0; font-family: Georgia, serif; font-size: 1.25rem; font-weight: 500; }
.certificate-info p, .certificate-info small { margin: 0; color: #768397; font-size: 0.78rem; }
.certificate-info small { display: inline-block; margin-top: 0.28rem; }
.certificate-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; }
.action-primary, .action-secondary { min-height: 2.45rem; display: inline-flex; align-items: center; justify-content: center; padding: 0.6rem 0.85rem; border-radius: 0.55rem; font-size: 0.76rem; font-weight: 750; text-decoration: none; cursor: pointer; }
.action-primary { border: 1px solid #173b67; color: #fff; background: #173b67; }
.action-secondary { border: 1px solid #ccd6e0; color: #42566d; background: #fff; }
button.action-secondary { font-family: inherit; }
.results-note { margin: 1.5rem 0 0; color: #818d9c; font-size: 0.75rem; text-align: center; }
.message-icon.error { color: #a33a3a; background: #fdeaea; font-weight: 800; }

@media (max-width: 760px) {
  .site-header { min-height: 4.8rem; }
  .system-pill, .secure-pill { font-size: 0; }
  .system-pill i { font-size: initial; }
  .secure-pill svg { width: 1.25rem; }
  .home-shell { min-height: auto; grid-template-columns: 1fr; gap: 2.5rem; padding: 3.5rem 0; }
  .process-card { order: 2; }
  .verified-header { align-items: flex-start; }
  .verified-icon { width: 3.5rem; height: 3.5rem; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .certificate-card { grid-template-columns: auto 1fr; align-items: start; }
  .certificate-actions { grid-column: 1 / -1; justify-content: stretch; }
  .certificate-actions > * { flex: 1 1 8rem; }
}

@media (max-width: 430px) {
  .hero h1 { font-size: 3rem; }
  .scan-card { align-items: flex-start; }
  .certificate-card { grid-template-columns: 1fr; }
  .document-icon { display: none; }
  .certificate-actions { grid-column: auto; }
  .verified-header { gap: 0.8rem; }
  .issuer-link { display: none; }
}

/* Panel de emisión */
.admin-body { background: #edf1f5; }
.admin-header { min-height: 5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 max(1rem, calc((100vw - 74rem) / 2)); color: #fff; background: #102a4a; }
.brand-light { color: #fff; }
.brand-light .brand-mark { border: 1px solid rgba(255,255,255,0.22); }
.brand-light small { color: #9fb4c9; }
.admin-nav { display: flex; align-items: center; gap: 1rem; color: #afc0d1; font-size: 0.78rem; }
.admin-nav a, .admin-nav button { border: 0; color: inherit; background: transparent; font: inherit; text-decoration: none; cursor: pointer; }
.admin-nav form { margin: 0; }
.admin-nav button { padding: 0.55rem 0.7rem; border: 1px solid rgba(255,255,255,0.18); border-radius: 0.45rem; }

.admin-login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 0.95fr; }
.admin-login-brand { min-height: 100vh; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(2rem, 6vw, 5rem); color: #fff; background: #102a4a; }
.admin-login-brand > div { max-width: 38rem; margin: auto 0; }
.admin-login-brand .eyebrow { color: #8ac0df; }
.admin-login-brand h1 { margin: 0; font: 500 clamp(3rem, 6vw, 5.8rem)/0.98 Georgia, serif; letter-spacing: -0.05em; }
.admin-login-brand p:last-child { max-width: 34rem; color: #aec0d3; line-height: 1.65; }
.admin-login-panel { display: grid; place-items: center; padding: 2rem; background: #f7f8fa; }
.login-form-wrap { width: min(100%, 25rem); }
.login-form-wrap h2 { margin: 0; font: 500 2.6rem/1 Georgia, serif; }
.login-form-wrap > p:not(.eyebrow) { color: #728095; line-height: 1.55; }
.login-form-wrap label { margin-top: 1.25rem; }
.back-link { display: block; margin-top: 1.5rem; color: #6f7d8f; font-size: 0.78rem; text-align: center; text-decoration: none; }

.admin-input { width: 100%; min-height: 3.05rem; padding: 0.75rem 0.85rem; border: 1px solid #cbd5df; border-radius: 0.6rem; outline: none; color: #14233b; background: #fff; }
.admin-input:focus { border-color: #2871a5; box-shadow: 0 0 0 0.2rem rgba(40,113,165,0.11); }
.admin-shell, .admin-form-shell, .admin-detail-shell { width: min(100% - 2rem, 74rem); margin: 0 auto; padding: 3rem 0 5rem; }
.dashboard-heading { display: flex; justify-content: space-between; align-items: end; gap: 2rem; }
.dashboard-heading h1, .admin-form-intro h1, .admin-detail-card h1 { margin: 0; font: 500 clamp(2.4rem, 6vw, 4rem)/1 Georgia, serif; letter-spacing: -0.04em; }
.dashboard-heading > div > p:last-child, .admin-form-intro > p:last-of-type { color: #6f7e91; }
.admin-primary, .admin-secondary { min-height: 2.8rem; display: inline-flex; align-items: center; justify-content: center; padding: 0.7rem 1rem; border-radius: 0.55rem; font-size: 0.8rem; font-weight: 750; text-decoration: none; cursor: pointer; }
.admin-primary { border: 1px solid #155a8a; color: #fff; background: #155a8a; }
.admin-secondary { border: 1px solid #c5d0db; color: #385069; background: #fff; }
button.admin-primary { font: inherit; font-weight: 750; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; margin: 2.2rem 0; }
.stats-row article { padding: 1.2rem; border: 1px solid #d8dfe7; border-radius: 0.8rem; background: #fff; }
.stats-row span, .stats-row strong { display: block; }
.stats-row span { color: #7d8998; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; }
.stats-row strong { margin-top: 0.4rem; font: 500 1.7rem Georgia, serif; }
.admin-table-card, .admin-form-card, .admin-detail-card { border: 1px solid #d8dfe7; border-radius: 1rem; background: #fff; box-shadow: 0 0.8rem 2.2rem rgba(21,42,70,0.06); }
.table-heading { display: flex; justify-content: space-between; align-items: center; padding: 1.2rem 1.4rem; border-bottom: 1px solid #e1e6ec; }
.table-heading h2 { margin: 0; font: 500 1.35rem Georgia, serif; }
.table-heading span { color: #8994a2; font-size: 0.72rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.95rem 1.2rem; border-bottom: 1px solid #edf0f3; text-align: left; font-size: 0.8rem; }
th { color: #768397; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; }
td strong, td small { display: block; }
td small { margin-top: 0.18rem; color: #8793a1; }
td a { color: #19608e; font-weight: 700; text-decoration: none; white-space: nowrap; }
.admin-empty { padding: 4rem 1rem; color: #718094; text-align: center; }
.admin-empty strong { color: #263b54; font: 500 1.35rem Georgia, serif; }
.admin-empty p { margin: 0.5rem 0 0; }

.admin-form-shell { display: grid; grid-template-columns: 0.65fr 1.35fr; gap: 3rem; align-items: start; }
.admin-form-intro { padding-top: 1.3rem; }
.template-note { margin-top: 2rem; padding: 1rem; border-left: 3px solid #2871a5; background: #e4edf4; }
.template-note strong, .template-note span { display: block; }
.template-note span { margin-top: 0.25rem; color: #607387; font-size: 0.76rem; }
.branding-status { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.8rem; color: #536b82; font-size: 0.72rem; }
.branding-status i { width: 0.48rem; height: 0.48rem; margin-left: 0.4rem; border-radius: 50%; }
.branding-status i:first-child { margin-left: 0; }
.branding-status .ready { background: #19875a; }
.branding-status .missing { background: #c07a29; }
.admin-primary:disabled { opacity: 0.48; cursor: not-allowed; }
.admin-form-card { padding: clamp(1.4rem, 4vw, 2.2rem); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.field-wide { grid-column: 1 / -1; }
.field label { margin-bottom: 0.45rem; }
.form-submit-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.8rem; padding-top: 1.5rem; border-top: 1px solid #e1e6ec; }
.form-submit-row p { margin: 0; color: #7c8999; font-size: 0.75rem; }

.success-banner { padding: 0.9rem 1.1rem; border-radius: 0.7rem; color: #176646; background: #dff3e9; font-weight: 700; }
.admin-detail-card { display: grid; grid-template-columns: 1fr 18rem; gap: 3rem; padding: clamp(1.5rem, 5vw, 3rem); }
.detail-copy dl { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin: 2rem 0; }
.detail-copy dl div { padding-top: 0.9rem; border-top: 1px solid #e1e6ec; }
.detail-copy dt { color: #7a8798; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; }
.detail-copy dd { margin: 0.35rem 0 0; color: #243a53; font-weight: 700; }
.detail-actions { display: flex; gap: 0.6rem; }
.qr-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.4rem; border-radius: 0.8rem; background: #eef3f7; text-align: center; }
.qr-panel img { width: 12rem; max-width: 100%; border: 0.6rem solid #fff; }
.qr-panel strong { margin-top: 0.8rem; }
.qr-panel a { max-width: 100%; margin-top: 0.4rem; overflow-wrap: anywhere; color: #577087; font-size: 0.68rem; }

@media (max-width: 800px) {
  .admin-login-shell { grid-template-columns: 1fr; }
  .admin-login-brand { min-height: 34rem; }
  .admin-login-panel { min-height: 36rem; }
  .admin-form-shell, .admin-detail-card { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr; }
  .dashboard-heading { align-items: flex-start; flex-direction: column; }
  .admin-primary { width: 100%; }
  .detail-actions .admin-primary { width: auto; }
}

@media (max-width: 540px) {
  .admin-header { min-height: 4.5rem; }
  .admin-nav span { display: none; }
  .form-grid, .detail-copy dl { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .form-submit-row { align-items: stretch; flex-direction: column; }
  .detail-actions { flex-direction: column; }
  .detail-actions .admin-primary { width: 100%; }
}
