:root {
  --guinda: #86113d;
  --guinda-dark: #4f071f;
  --oro: #d8b15f;
  --ink: #16171b;
  --paper: #f5f3ef;
  --nav-height: 76px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  min-width: 320px;
  overflow-x: hidden;
  padding-top: var(--nav-height);
  background: var(--paper);
  color: var(--ink);
}

.navbar-pj {
  min-height: var(--nav-height);
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  background:
    linear-gradient(135deg, rgba(79, 7, 31, .92), rgba(14, 15, 19, .88)),
    rgba(14, 15, 19, .9);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .18);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
}

.brand-logo {
  width: auto;
  max-width: 220px;
  height: 45px;
  object-fit: contain;
}

.navbar-pj .navbar-toggler {
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 8px;
  box-shadow: none;
}

.navbar-pj .navbar-toggler:focus {
  box-shadow: 0 0 0 .2rem rgba(216, 177, 95, .28);
}

.navbar-pj .navbar-nav {
  gap: .2rem;
}

.navbar-pj .nav-link {
  border-radius: 999px;
  padding: .55rem .85rem;
  color: rgba(255, 255, 255, .82);
  font-weight: 600;
  font-size: .94rem;
  text-decoration: none;
  transition: color .2s ease, background-color .2s ease, transform .2s ease;
}

.navbar-pj .nav-link:hover,
.navbar-pj .nav-link:focus,
.navbar-pj .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, .12);
}

.navbar-pj .nav-link.active {
  box-shadow: inset 0 0 0 1px rgba(216, 177, 95, .55);
}

.hero-carousel {
  overflow: hidden;
  background: #121318;
  box-shadow: 0 18px 34px rgba(0, 0, 0, .12);
}

.hero-carousel .carousel-inner {
  background: #121318;
}

.hero-carousel .carousel-item {
  aspect-ratio: auto;
}

.hero-image {
  object-fit: contain;
  object-position: center;
}

.carousel-indicators {
  right: 1.25rem;
  bottom: 1.1rem;
  left: auto;
  align-items: center;
  justify-content: flex-end;
  gap: .45rem;
  margin: 0;
}

.carousel-indicators [data-bs-target] {
  width: .65rem;
  height: .65rem;
  border: 0;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, .66);
  opacity: 1;
}

.carousel-indicators .active {
  width: 1.6rem;
  border-radius: 999px;
  background-color: var(--oro);
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, .86);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
  filter: none;
}

.carousel-control-prev-icon {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M10.5 2 4.5 8l6 6' fill='none' stroke='%2386113d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

.carousel-control-next-icon {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M5.5 2 11.5 8l-6 6' fill='none' stroke='%2386113d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

.site-image {
  width: 100%;
  height: auto;
  display: block;
}

.hero-carousel .hero-image {
  height: auto;
}

.section-block {
  position: relative;
  overflow: hidden;
  background: #e7e4dc;
}

.image-stage {
  position: relative;
  width: 100%;
  background: #e7e4dc;
}

.content-image {
  min-height: 120px;
}

.hotspot {
  position: absolute;
  display: block;
  text-decoration: none;
  background: transparent;
  cursor: pointer;
}

.hotspot:focus {
  border-radius: 10px;
  outline: 3px solid rgba(216, 177, 95, .95);
  outline-offset: 3px;
}

body.debug .hotspot {
  outline: 2px dashed rgba(220, 53, 69, .95);
  background: rgba(220, 53, 69, .18);
}

body.debug .hotspot::after {
  content: attr(data-label);
  position: absolute;
  left: 0;
  top: 0;
  max-width: 100%;
  padding: .2rem .35rem;
  background: rgba(0, 0, 0, .78);
  color: #fff;
  font-size: .75rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Ajusta left/top/width/height en porcentajes relativos a cada imagen. */
#seccion-convocatoria .btn-bases { left: 27%; top: 61%; width: 46%; height: 13%; }
#seccion-documentos .btn-doc1 { left: 7.5%; top: 85%; width: 20%; height: 12%; }
#seccion-documentos .btn-doc2 { left: 39%; top: 85%; width: 22%; height: 12%; }
#seccion-documentos .btn-doc3 { left: 72%; top: 85%; width: 20%; height: 12%; }
#seccion-registro .btn-registro { left: 50%; top: 34%; width: 42%; height: 35%; }
#seccion-contacto .btn-buzon { left: 18%; top: 78%; width: 17%; height: 15%; }
#seccion-contacto .btn-lineamientos { left: 53%; top: 78%; width: 35%; height: 15%; }

.btn-guinda {
  border-color: var(--guinda);
  border-radius: 8px;
  background: var(--guinda);
  color: #fff;
  font-weight: 700;
}

.btn-guinda:hover,
.btn-guinda:focus {
  color: #fff;
  filter: brightness(.92);
}

.form-slim {
  width: 100%;
  margin: 0 auto;
}

.modal-backdrop.show {
  opacity: .72;
}

.buzon-dialog {
  --bs-modal-width: 860px;
}

.modal-content {
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #fbfaf7;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .34);
}

.buzon-modal {
  border: 1px solid rgba(255, 255, 255, .45);
}

.modal-header {
  border-bottom: 0;
}

.buzon-modal-header {
  position: relative;
  align-items: flex-start;
  padding: 1.35rem 1.55rem 1.2rem;
  background:
    linear-gradient(135deg, rgba(134, 17, 61, .98), rgba(56, 8, 30, .98)),
    var(--guinda);
  color: #fff;
}

.buzon-modal-header::after {
  content: "";
  position: absolute;
  right: 1.55rem;
  bottom: 0;
  left: 1.55rem;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, transparent, var(--oro), transparent);
}

.modal-title-wrap {
  min-width: 0;
}

.modal-kicker {
  margin-bottom: .25rem;
  color: rgba(255, 255, 255, .72);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
}

.buzon-modal .modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.2;
}

.buzon-close {
  width: 2.25rem;
  height: 2.25rem;
  margin: -.25rem -.3rem 0 1rem;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, .12);
  background-size: .8rem;
  opacity: .9;
  transition: background-color .2s ease, opacity .2s ease;
}

.buzon-close:hover,
.buzon-close:focus {
  background-color: rgba(255, 255, 255, .22);
  opacity: 1;
}

.buzon-modal .modal-body {
  padding: 1.55rem 1.55rem 1.2rem;
}

.buzon-modal .modal-footer {
  gap: .75rem;
  padding: 1rem 1.55rem 1.2rem;
  border-top: 1px solid rgba(79, 7, 31, .12);
  background: linear-gradient(180deg, rgba(255, 255, 255, .45), rgba(245, 243, 239, .9));
}

.buzon-modal .form-label {
  margin-bottom: .45rem;
  color: #26242a;
  font-size: .94rem;
  font-weight: 700;
}

.form-control,
.form-check-input,
.btn {
  box-shadow: none;
}

.buzon-modal .form-control {
  min-height: 2.85rem;
  border: 1px solid #d9d6ce;
  border-radius: 10px;
  background-color: #fff;
  color: #25242a;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.buzon-modal textarea.form-control {
  min-height: 10.5rem;
  resize: vertical;
}

.buzon-modal .form-control::placeholder {
  color: #8a8790;
}

.form-control:focus,
.form-check-input:focus {
  border-color: var(--guinda);
  box-shadow: 0 0 0 .2rem rgba(134, 17, 61, .16);
}

.buzon-modal .form-check-input {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: .17rem;
  border-color: #c9c4ba;
}

.buzon-modal .form-check-input:checked {
  border-color: var(--guinda);
  background-color: var(--guinda);
}

.consent-check {
  margin-top: .25rem;
  padding: .9rem 1rem .9rem 2.65rem;
  border: 1px solid rgba(134, 17, 61, .13);
  border-radius: 12px;
  background: rgba(134, 17, 61, .045);
}

.consent-check .form-check-input {
  margin-left: -1.65rem;
}

.consent-check .form-check-label {
  color: #302e34;
  font-size: .94rem;
  line-height: 1.45;
}

.buzon-modal .btn {
  min-width: 104px;
  border-radius: 10px;
  padding: .62rem 1.05rem;
  font-weight: 800;
}

.buzon-modal .btn-outline-secondary {
  border-color: #b8b2a8;
  color: #5d5962;
  background: #fff;
}

.buzon-modal .btn-outline-secondary:hover,
.buzon-modal .btn-outline-secondary:focus {
  border-color: #958d82;
  color: #2f2b33;
  background: #f2efe9;
}

.buzon-modal .btn-guinda {
  border-color: transparent;
  background: linear-gradient(135deg, var(--guinda), var(--guinda-dark));
  box-shadow: 0 12px 28px rgba(134, 17, 61, .22);
}

.buzon-modal .btn-guinda:disabled {
  border-color: #c8c3ba;
  background: #ece8df;
  color: #8a8490;
  box-shadow: none;
  opacity: 1;
}

.char-count {
  color: #6c757d;
  font-size: .875rem;
}

#buzonAlerts {
  z-index: 1080;
  width: min(640px, 92vw);
}

footer {
  padding-top: 1.35rem !important;
  padding-bottom: 1.35rem !important;
  background:
    linear-gradient(135deg, #17181d, var(--guinda-dark)) !important;
}

footer p {
  margin-right: auto;
  margin-left: auto;
  max-width: 760px;
  font-size: .95rem;
  line-height: 1.55;
}

.footer-logo {
  width: auto;
  max-width: 230px;
  height: 55px;
  object-fit: contain;
}

@media (max-width: 991.98px) {
  .navbar-pj .container {
    max-width: 100%;
  }

  .navbar-pj .navbar-collapse {
    margin-top: .75rem;
    padding: .7rem;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    background: rgba(17, 18, 23, .78);
  }

  .navbar-pj .navbar-nav {
    gap: .15rem;
  }

  .navbar-pj .nav-link {
    border-radius: 8px;
    padding: .72rem .85rem;
  }
}

@media (max-width: 767.98px) {
  .hero-carousel .carousel-item {
    aspect-ratio: auto;
  }

  .hero-image {
    object-fit: contain;
  }

  .carousel-control-prev-icon,
  .carousel-control-next-icon {
    width: 2.45rem;
    height: 2.45rem;
  }

  .carousel-indicators {
    right: .9rem;
    bottom: .75rem;
  }

  .section-block {
    overflow-x: hidden;
    overscroll-behavior-x: auto;
    scroll-snap-type: none;
  }

  .image-stage {
    width: 100%;
    max-width: 100%;
    scroll-snap-align: none;
  }

  footer {
    padding-top: 1.05rem !important;
    padding-bottom: 1.05rem !important;
  }

  footer .row {
    --bs-gutter-y: .85rem;
  }

  footer .mt-4 {
    margin-top: 1rem !important;
  }

  footer p {
    max-width: 30rem;
    font-size: .82rem;
    line-height: 1.45;
  }

  .footer-logo {
    max-width: 155px;
    height: 36px;
  }

  footer .col-md-4:first-child .footer-logo {
    max-width: 170px;
    height: 38px;
  }

  footer .col-md-4:last-child .footer-logo {
    max-width: 175px;
    height: 42px;
  }
}

@media (max-width: 575.98px) {
  :root {
    --nav-height: 66px;
  }

  .brand-logo {
    height: 36px;
    max-width: 170px;
  }

  footer {
    padding-top: .9rem !important;
    padding-bottom: .9rem !important;
  }

  footer .container {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  footer .row {
    --bs-gutter-y: .7rem;
  }

  footer p {
    max-width: 21rem;
    font-size: .76rem;
    line-height: 1.4;
  }

  .footer-logo {
    max-width: 132px;
    height: 30px;
  }

  footer .col-md-4:first-child .footer-logo {
    max-width: 146px;
    height: 32px;
  }

  footer .col-md-4:last-child .footer-logo {
    max-width: 152px;
    height: 36px;
  }

  .buzon-modal {
    min-height: 100%;
    border-radius: 0;
  }

  .buzon-modal-header {
    padding: 1.1rem 1rem 1rem;
  }

  .buzon-modal-header::after {
    right: 1rem;
    left: 1rem;
  }

  .buzon-modal .modal-title {
    font-size: 1.08rem;
  }

  .modal-kicker {
    font-size: .66rem;
  }

  .buzon-close {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
  }

  .buzon-modal .modal-body {
    padding: 1rem;
  }

  .buzon-modal textarea.form-control {
    min-height: 8.5rem;
  }

  .consent-check {
    padding-right: .85rem;
  }

  .buzon-modal .modal-footer {
    display: grid;
    grid-template-columns: 1fr;
    padding: .85rem 1rem 1rem;
  }

  .buzon-modal .modal-footer .btn {
    width: 100%;
  }
}
