:root {
  --navy: #0e3a6b;
  --navy-dark: #0b2e4a;
  --blue: #1e6bb8;
  --blue-soft: #e8f1fb;
  --ice: #f4f7fb;
  --white: #ffffff;
  --text: #1c2b3a;
  --muted: #5c6b7a;
  --line: #d9e2ec;
  --ok: #2f9e44;
  --warn: #e8590c;
  --danger: #c92a2a;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(14, 58, 107, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body.public-body {
  font-family: "Source Sans 3", system-ui, sans-serif;
  color: var(--text);
  background: var(--ice);
  min-height: 100%;
  overflow-x: hidden;
}
h1, h2, h3, .brand-text strong, .wizard-title {
  font-family: Outfit, "Source Sans 3", sans-serif;
}
a { color: var(--blue); }

.skip-link {
  position: absolute; left: -999px; top: 0;
}
.skip-link:focus { left: 8px; background: #fff; padding: 8px; z-index: 10; }

.site-header {
  background: #fff;
  color: var(--navy);
  position: sticky; top: 0; z-index: 20;
  box-shadow: 0 4px 16px rgba(11, 46, 74, 0.08);
  border-bottom: 1px solid #e7eef6;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 76px; gap: 12px;
}
.brand {
  display: flex; align-items: center; gap: 12px; color: var(--navy); text-decoration: none;
  min-width: 0;
}
.brand-official {
  height: 44px;
  width: auto;
  max-width: min(52vw, 220px);
  object-fit: contain;
  flex-shrink: 1;
}
.brand-official-lg { height: 64px; max-width: 280px; }
.brand-logo {
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--blue-soft);
  display: grid; place-items: center; font-size: 1.4rem;
  flex-shrink: 0;
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 14px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong {
  letter-spacing: .06em; font-size: .78rem; color: var(--navy);
  border-left: 2px solid var(--blue); padding-left: 10px;
}
.brand-text span { font-size: .78rem; opacity: .85; letter-spacing: .12em; }
.header-nav { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.header-nav a { color: var(--navy); text-decoration: none; font-weight: 600; }
.nav-staff { opacity: .75; color: var(--navy); }

.hero {
  background:
    radial-gradient(1200px 400px at 80% -20%, rgba(30,107,184,.45), transparent),
    linear-gradient(160deg, var(--navy-dark), var(--navy) 55%, #164a82);
  color: #fff;
  padding: 52px 0 64px;
}
.hero-kicker { text-transform: uppercase; letter-spacing: .16em; font-size: .78rem; opacity: .8; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 800; line-height: 1.15; margin: 8px 0 16px; }
.hero-lead { font-size: 1.15rem; max-width: 36rem; opacity: .92; }
.hero-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; max-width: 420px; }
.hero-actions .btn { text-transform: uppercase; letter-spacing: .03em; }

.btn { border-radius: 14px; font-weight: 700; }
.btn-cta {
  background: #fff; color: var(--navy); border: 0;
  min-height: 56px; font-size: 1.05rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: var(--shadow);
}
.btn-cta:hover { background: #eef5ff; color: var(--navy); }
.btn-ghost {
  background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.45);
  min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.wizard-card .btn-ghost, .success-card .btn-ghost {
  color: var(--navy); border-color: var(--line);
}

.section-cats, .section-how, .page-wrap { padding: 36px 0 48px; }
.section-emergency { padding: 20px 0 0; }
.section-emergency .alert-emergency { margin: 0; }
.section-title { font-size: 1.45rem; margin-bottom: 6px; }
.section-sub { color: var(--muted); margin-bottom: 20px; }
.cat-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.cat-card {
  background: #fff; border-radius: var(--radius);
  padding: 16px 12px; text-decoration: none; color: var(--text);
  box-shadow: var(--shadow); border: 1px solid #eef2f6;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  min-height: 108px;
}
.cat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: color-mix(in srgb, var(--cat) 16%, #fff);
  color: var(--cat); display: grid; place-items: center; font-size: 1.3rem;
}
.cat-name { font-weight: 600; font-size: .95rem; }
.how-grid { display: grid; gap: 12px; }
.how-card {
  background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.how-num {
  width: 32px; height: 32px; border-radius: 50%; background: var(--blue-soft); color: var(--navy);
  display: grid; place-items: center; font-weight: 800; margin-bottom: 8px;
}

.narrow { max-width: 640px; }
.wizard-card, .success-card {
  background: #fff; border-radius: 20px; padding: 22px 18px 24px;
  box-shadow: var(--shadow); border: 1px solid #eef2f6;
}
.wizard-progress { display: flex; gap: 8px; margin-bottom: 8px; }
.wizard-progress span {
  flex: 1; height: 6px; background: #e6edf5; border-radius: 99px;
}
.wizard-progress span.on { background: var(--blue); }
.wizard-labels {
  display: flex; justify-content: space-between; list-style: none; padding: 0; margin: 0 0 18px;
  font-size: .78rem; color: var(--muted);
}
.wizard-labels li.on { color: var(--navy); font-weight: 700; }
.wizard-title { font-size: 1.45rem; margin-bottom: 8px; }
.wizard-help { color: var(--muted); }

.form-control, .form-select {
  border-radius: 12px; border-color: var(--line); min-height: 48px;
}
.form-control-lg { min-height: 52px; font-size: 1.05rem; }
.form-label { font-weight: 600; }
.tiny-help { color: var(--muted); font-size: .88rem; }
.invalid-msg { color: var(--danger); font-size: .9rem; margin-top: 6px; }
.honeypot { position: absolute; left: -9999px; height: 0; overflow: hidden; }

.cat-select-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cat-select input { position: absolute; opacity: 0; }
.cat-select-inner {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--ice); border: 2px solid transparent; border-radius: 14px;
  padding: 14px 8px; min-height: 92px; text-align: center; font-weight: 600; font-size: .9rem;
}
.cat-select input:checked + .cat-select-inner {
  border-color: var(--blue); background: var(--blue-soft);
}
.cat-select-inner i { font-size: 1.4rem; }

.upload-drop {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 2px dashed var(--blue); border-radius: 16px; padding: 22px;
  background: var(--blue-soft); cursor: pointer; text-align: center;
}
.upload-drop input { display: none; }
.upload-drop i { font-size: 1.8rem; color: var(--blue); }
.preview-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.preview-list img, .preview-list video {
  width: 100%; height: 88px; object-fit: cover; border-radius: 10px;
}

.alert-emergency {
  display: flex; gap: 12px; background: #fff6e9; border: 1px solid #ffd8a8;
  color: #7c4a03; border-radius: 16px; padding: 14px;
}
.emergency-chip {
  display: inline-block; background: #fff; border-radius: 999px; padding: 4px 10px;
  margin: 4px 4px 0 0; font-size: .85rem;
}
.privacy-note {
  background: var(--ice); border-radius: 12px; padding: 12px; font-size: .92rem;
}
.summary-card {
  background: var(--ice); border-radius: 12px; padding: 14px; margin-top: 12px; font-size: .95rem;
}
.similar-box {
  background: #fff4e6; border: 1px solid #ffd8a8; border-radius: 12px; padding: 12px; margin-top: 8px;
}

.success-card { text-align: center; }
.success-icon {
  width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 50%;
  background: #d3f9d8; color: var(--ok); display: grid; place-items: center; font-size: 2rem;
}
.ticket {
  background: var(--ice); border-radius: 14px; padding: 14px; margin: 16px 0;
}
.ticket span { display: block; color: var(--muted); font-size: .85rem; }
.ticket strong { font-size: 1.35rem; letter-spacing: .04em; word-break: break-word; }
.save-banner {
  background: #fff4e6; border: 1px solid #ffd8a8; border-radius: 14px;
  padding: 14px; text-align: left; color: #7c4a03; margin-top: 8px;
}
.save-banner strong { display: block; margin-bottom: 4px; }
.qr-box {
  margin-top: 20px; padding: 16px; background: var(--ice); border-radius: 14px; text-align: center;
}
.qr-box img {
  width: 180px; height: 180px; margin: 0 auto 12px; display: block;
  background: #fff; border-radius: 12px; padding: 8px;
}

.progress-track {
  list-style: none; padding: 0; margin: 16px 0 0;
  display: flex; flex-direction: column;
}
.progress-step {
  display: grid; grid-template-columns: 40px 1fr; gap: 12px;
  position: relative; padding-bottom: 20px;
}
.progress-step:last-child { padding-bottom: 0; }
.progress-step:not(:last-child)::before {
  content: ""; position: absolute; left: 19px; top: 40px; bottom: 0; width: 2px;
  background: var(--line);
}
.progress-step.is-done:not(:last-child)::before { background: #2f9e44; }
.progress-mark {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.1rem;
  border: 2px solid #868e96; background: #fff; color: #495057;
}
.progress-step.is-done .progress-mark {
  background: #d3f9d8; color: #2b8a3e; border-color: #2b8a3e;
}
.progress-step.is-current .progress-mark {
  background: var(--navy); color: #fff; border-color: var(--navy);
}
.progress-body strong { display: block; font-size: 1rem; }
.progress-body time { display: block; font-size: .82rem; color: var(--muted); font-weight: 500; margin-top: 2px; }

.badge-status, .badge-prio {
  display: inline-block; border-radius: 999px; padding: 4px 10px; font-size: .8rem; font-weight: 700;
}
.badge-recibido { background: #d0ebff; color: #1864ab; }
.badge-en_revision { background: #dbe4ff; color: #364fc7; }
.badge-asignado { background: #eebefa; color: #862e9c; }
.badge-en_proceso { background: #ffe8cc; color: #d9480f; }
.badge-resuelto { background: #d3f9d8; color: #2b8a3e; }
.badge-rechazado { background: #e9ecef; color: #495057; }
.timeline { padding-left: 18px; }
.public-dl div { margin-bottom: 10px; }
.public-dl dt { font-size: .8rem; color: var(--muted); }
.public-update { background: var(--ice); border-radius: 12px; padding: 12px; margin-top: 8px; }
.public-update time { font-size: .8rem; color: var(--muted); }

.site-footer {
  background: var(--navy-dark); color: rgba(255,255,255,.82); padding: 28px 0;
  margin-top: 24px; font-size: .92rem;
}
.footer-copy { opacity: .7; margin-bottom: 0; }
.login-wrap { max-width: 440px; margin: 48px auto; padding: 0 16px; }

@media (max-width: 420px) {
  .brand-text { display: none; }
  .brand-official { height: 40px; max-width: 58vw; }
}
@media (min-width: 768px) {
  .hero-actions { flex-direction: row; max-width: none; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .how-grid { grid-template-columns: repeat(3, 1fr); }
  .hero { padding: 80px 0 96px; }
  .wizard-card, .success-card { padding: 32px; }
  .brand-official { height: 52px; max-width: 260px; }
  .progress-track {
    flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 0;
  }
  .progress-step {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    text-align: center; grid-template-columns: none; padding: 0 6px;
  }
  .progress-step:not(:last-child)::before {
    left: calc(50% + 22px); right: calc(-50% + 22px); top: 19px; bottom: auto;
    height: 2px; width: auto;
  }
}
