:root {
  --azul: #043768;
  --azul-oscuro: #032a52;
  --azul-link: #0b57a3;
  --fondo: #f4f6f9;
  --blanco: #ffffff;
  --texto: #0b1b2b;
  --texto-muted: #5a6578;
  --linea: #e6ebf3;
  --radio: 12px;
  --sombra: 0 10px 30px rgba(2, 19, 46, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--fondo);
  color: var(--texto);
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  background: var(--blanco);
  border-bottom: 1px solid var(--linea);
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-text {
  font-size: 16px;
  font-weight: 800;
  color: var(--azul);
}

.brand-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--linea);
  background: var(--blanco);
  cursor: pointer;
}

.nav-toggle-bars {
  width: 18px;
  height: 12px;
  position: relative;
  display: block;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #2b3c55;
  border-radius: 999px;
}

.nav-toggle-bars::before {
  top: 0;
  box-shadow: 0 5px 0 #2b3c55, 0 10px 0 #2b3c55;
}

.nav-toggle-bars::after {
  display: none;
}

.nav-panel {
  display: flex;
  align-items: center;
}

.nav-panel.is-open {
  display: flex;
}

.nav-link {
  font-size: 14px;
  font-weight: 600;
  color: #2b3c55;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(4, 55, 104, 0.06);
  border: 1px solid rgba(4, 55, 104, 0.12);
}

.nav-link:hover {
  background: rgba(4, 55, 104, 0.1);
}

.nav-link-primary {
  background: var(--azul);
  color: #fff;
  padding: 8px 14px;
}

.nav-link-primary:hover {
  background: var(--azul-oscuro);
}

.hero {
  background: linear-gradient(180deg, var(--azul) 0%, var(--azul-oscuro) 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 52px 52px;
  opacity: 0.55;
}

.hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 86px 20px 84px;
  position: relative;
}

.hero-title {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: #fff;
  margin-bottom: 0;
  max-width: 720px;
}

.hero-subtitle {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  max-width: 520px;
  line-height: 1.55;
}

.main {
  background: #f7f9fc;
  padding: 54px 20px 74px;
}

.tramites {
  max-width: 1120px;
  margin: 0 auto;
}

.tramites-title {
  text-align: center;
  font-size: 32px;
  font-weight: 800;
  color: var(--azul);
  margin-bottom: 34px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
  max-width: 900px;
  margin: 0 auto;
}

.card {
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  padding: 34px 26px;
  box-shadow: var(--sombra);
  text-align: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.card-button {
  width: 100%;
  font: inherit;
  color: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(11, 87, 163, 0.35);
  box-shadow: 0 14px 40px rgba(2, 19, 46, 0.16);
}

.card-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: var(--azul);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.card-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--azul);
  margin-bottom: 12px;
}

.card-text {
  font-size: 14px;
  color: var(--texto-muted);
  line-height: 1.5;
  max-width: 420px;
  margin: 0 auto;
}

.card-action {
  display: inline-block;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 800;
  color: var(--azul-link);
}

body.modal-open {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 19, 46, 0.48);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(2, 19, 46, 0.28);
  padding: 28px 24px 24px;
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.modal-overlay.is-open .modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .modal-overlay,
  .modal {
    transition: none;
  }
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--texto-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: rgba(4, 55, 104, 0.08);
  color: var(--azul);
}

.modal-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--azul);
  margin-bottom: 8px;
  padding-right: 28px;
}

.modal-text {
  font-size: 14px;
  color: var(--texto-muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-label {
  font-size: 13px;
  font-weight: 700;
  color: #2b3c55;
}

.modal-input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--linea);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--texto);
  background: #fff;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.modal-input:focus {
  border-color: rgba(11, 87, 163, 0.55);
  box-shadow: 0 0 0 3px rgba(11, 87, 163, 0.12);
}

.modal-submit {
  margin-top: 10px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: var(--azul);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.12s ease;
}

.modal-submit:hover {
  background: var(--azul-oscuro);
}

.modal-resultado {
  margin-top: 16px;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid var(--linea);
}

.modal-resultado.is-ok {
  background: rgba(22, 128, 72, 0.08);
  border-color: rgba(22, 128, 72, 0.28);
  color: #146c3b;
}

.modal-resultado.is-error {
  background: rgba(176, 40, 40, 0.07);
  border-color: rgba(176, 40, 40, 0.28);
  color: #8f1f1f;
}

.modal-resultado-titulo {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 6px;
}

.modal-resultado-detalle p {
  margin-bottom: 6px;
}

.modal-resultado-lista {
  margin: 8px 0 0 18px;
  padding: 0;
}

.modal-resultado-lista li {
  margin-bottom: 4px;
}

.modal-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.footer {
  background: #043a67;
  color: rgba(255, 255, 255, 0.82);
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.12) 0, rgba(255, 255, 255, 0) 38%),
    radial-gradient(circle at 88% 28%, rgba(255, 255, 255, 0.08) 0, rgba(255, 255, 255, 0) 42%),
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: auto, auto, 56px 56px, 56px 56px;
  opacity: 0.35;
  pointer-events: none;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 30px 20px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 26px;
  align-items: start;
  justify-items: start;
  position: relative;
}

.footer-col {
  text-align: left;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.footer-brand .footer-title {
  margin-bottom: 0;
}

.footer-brand-logo {
  width: 34px;
  height: 34px;
  display: block;
  object-fit: contain;
  flex: 0 0 auto;
}

.footer-title {
  font-size: 13px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 10px;
}

.footer-text {
  font-size: 12px;
  line-height: 1.55;
  margin-bottom: 6px;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.footer-social-link {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.footer-social-link:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.footer-link {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 7px;
}

.footer-link:hover {
  color: #fff;
}

.footer-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 9px 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.footer-badge-label {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

.footer-badge-value {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}

.footer-divider {
  max-width: 1120px;
  margin: 0 auto;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
  position: relative;
}

.footer-bottom {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px 18px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  position: relative;
}

@media (max-width: 980px) {
  .cards {
    grid-template-columns: 1fr;
    max-width: 520px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 720px) {
  .hero-inner {
    padding: 64px 16px 58px;
  }

  .hero-title {
    font-size: 38px;
  }

  .topbar-inner {
    flex-direction: row;
    align-items: center;
  }

  .nav-wrap {
    flex: 0 0 auto;
  }

  .nav-toggle-btn {
    display: inline-flex;
  }

  .nav-panel {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: auto;
    min-width: 220px;
    max-width: calc(100vw - 40px);
    background: var(--blanco);
    border: 1px solid var(--linea);
    border-radius: 14px;
    box-shadow: 0 14px 40px rgba(2, 19, 46, 0.18);
    padding: 10px;
    z-index: 20;
  }

  .nav {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .nav-link {
    width: 100%;
    background: rgba(4, 55, 104, 0.06);
    padding: 10px 12px;
    border-radius: 12px;
  }
}
