/* ========== RESET Y BASE ========== */
* {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html,
body {
  height: 100%;
  margin: 0;
  scroll-behavior: smooth;
}

body {
  background: linear-gradient(135deg, #000000 0%, #0a0a0a 50%, #000000 100%);
  background-attachment: fixed;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding-top: 80px;
  position: relative;
  overflow-x: hidden;
}

/* Efecto de partículas de fondo sutil */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(66, 135, 245, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(212, 175, 55, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

@media (max-width: 991px) {
  body {
    padding-top: 120px;
  }
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
}

/* ========== TÍTULO PRINCIPAL ========== */
h1 {
  color: #d4af37;
  margin-bottom: 50px;
  text-align: center;
  font-weight: 800;
  font-size: 2.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #d4af37 0%, #f4d47c 50%, #d4af37 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 4px 12px rgba(212, 175, 55, 0.3));
  animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
  0%, 100% {
    filter: drop-shadow(0 4px 12px rgba(212, 175, 55, 0.3));
  }
  50% {
    filter: drop-shadow(0 4px 20px rgba(212, 175, 55, 0.5));
  }
}

/* ========== TARJETAS DEL DASHBOARD ========== */
.card-dashboard {
  background: linear-gradient(145deg, 
    rgba(15, 15, 15, 0.7) 0%, 
    rgba(10, 10, 10, 0.6) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(212, 175, 55, 0.15);
  border-radius: 20px;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-align: center;
  padding: 50px 30px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 280px;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.5),
    inset 0 1px 1px rgba(255, 255, 255, 0.03),
    inset 0 -1px 1px rgba(0, 0, 0, 0.3);
}

/* Borde superior brillante */
.card-dashboard::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(212, 175, 55, 0.6) 50%, 
    transparent 100%);
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* Efecto de luz radial central */
.card-dashboard::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(212, 175, 55, 0.12) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: all 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform: translate(-50%, -50%);
}

.card-dashboard i {
  font-size: 4.5rem;
  color: #d4af37;
  margin-bottom: 28px;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  filter: drop-shadow(0 6px 20px rgba(212, 175, 55, 0.25));
  position: relative;
  z-index: 2;
}

.card-dashboard h5 {
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 1.15rem;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.6);
  position: relative;
  z-index: 2;
  transition: all 0.4s ease;
}

/* Estados hover mejorados */
.card-dashboard:hover {
  transform: translateY(-20px) scale(1.03);
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.7),
    0 0 50px rgba(212, 175, 55, 0.25),
    inset 0 2px 2px rgba(255, 255, 255, 0.08),
    inset 0 -2px 2px rgba(0, 0, 0, 0.4);
  border-color: rgba(212, 175, 55, 0.7);
  background: linear-gradient(145deg, 
    rgba(20, 20, 20, 0.9) 0%, 
    rgba(15, 15, 15, 0.8) 100%);
}

.card-dashboard:hover::before {
  opacity: 1;
  animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

.card-dashboard:hover::after {
  width: 400px;
  height: 400px;
  opacity: 1;
}

.card-dashboard:hover i {
  transform: scale(1.2) translateY(-5px);
  color: #fff;
  filter: drop-shadow(0 8px 30px rgba(212, 175, 55, 0.7));
  animation: iconBounce 0.6s ease-out;
}

@keyframes iconBounce {
  0%, 100% {
    transform: scale(1.2) translateY(-5px);
  }
  50% {
    transform: scale(1.25) translateY(-8px);
  }
}

.card-dashboard:hover h5 {
  color: #d4af37;
  letter-spacing: 2.5px;
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

/* Animación de entrada escalonada */
.dashboard-row {
  margin-bottom: 30px;
}

.dashboard-row .col-lg-4,
.dashboard-row .col-md-6 {
  animation: fadeInUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

.dashboard-row .col-lg-4:nth-child(1) { animation-delay: 0.15s; }
.dashboard-row .col-lg-4:nth-child(2) { animation-delay: 0.3s; }
.dashboard-row .col-lg-4:nth-child(3) { animation-delay: 0.45s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ========== SECCIONES DIFERENCIADAS ========== */
.section-divider {
  margin-bottom: 5rem;
}

.section-header {
  margin-bottom: 3rem;
  padding: 2rem 3rem;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.section-header:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 16px 50px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Efecto de patrón de fondo sutil */
.section-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%),
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 10px,
      rgba(255, 255, 255, 0.01) 10px,
      rgba(255, 255, 255, 0.01) 20px
    );
  z-index: 0;
}

/* Línea decorativa superior */
.section-header::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 3px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    currentColor 50%, 
    transparent 100%);
  opacity: 0.4;
  z-index: 1;
}

/* Contenedor flex para icono + título en línea */
.section-header > * {
  position: relative;
  z-index: 2;
}

.section-header i {
  font-size: 2.8rem;
  display: inline-block;
  vertical-align: middle;
  margin-right: 1.2rem;
  filter: drop-shadow(0 4px 20px currentColor);
  animation: iconPulse 3s ease-in-out infinite;
  transition: all 0.3s ease;
}

@keyframes iconPulse {
  0%, 100% {
    filter: drop-shadow(0 4px 20px currentColor);
  }
  50% {
    filter: drop-shadow(0 6px 30px currentColor);
  }
}

.section-header:hover i {
  transform: scale(1.08) rotate(-5deg);
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin: 0;
  display: inline-block;
  vertical-align: middle;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.section-header p {
  font-size: 0.95rem;
  opacity: 0.85;
  margin: 1rem 0 0 0;
  letter-spacing: 0.8px;
  font-weight: 400;
  text-align: center;
  display: block;
  padding-left: 4rem;
}

/* ========== SECCIÓN PÚBLICA - AZUL ========== */
.public-section {
  background: linear-gradient(135deg, 
    rgba(26, 42, 108, 0.4) 0%, 
    rgba(15, 27, 61, 0.3) 100%);
  border: 2px solid rgba(66, 135, 245, 0.3);
  box-shadow: 
    0 8px 32px rgba(66, 135, 245, 0.15),
    inset 0 1px 0 rgba(66, 135, 245, 0.1);
}

.public-section i {
  color: #4287f5;
}

.public-section h2 {
  color: #4287f5;
  text-shadow: 0 0 30px rgba(66, 135, 245, 0.4);
}

.public-section p {
  color: #a8c5ff;
}

/* ========== SECCIÓN INTERNA - DORADO ========== */
.internal-section {
  background: linear-gradient(135deg, 
    rgba(42, 31, 12, 0.4) 0%, 
    rgba(26, 19, 8, 0.3) 100%);
  border: 2px solid rgba(212, 175, 55, 0.3);
  box-shadow: 
    0 8px 32px rgba(212, 175, 55, 0.15),
    inset 0 1px 0 rgba(212, 175, 55, 0.1);
}

.internal-section i {
  color: #d4af37;
}

.internal-section h2 {
  color: #d4af37;
  text-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
}

.internal-section p {
  color: #e8d7a8;
}

/* ========== TARJETAS DIFERENCIADAS ========== */
/* Tarjetas Públicas - Acento Azul */
.public-card {
  border-color: rgba(66, 135, 245, 0.25) !important;
}

.public-card i {
  color: #4287f5 !important;
  filter: drop-shadow(0 4px 16px rgba(66, 135, 245, 0.3)) !important;
}

.public-card:hover {
  border-color: rgba(66, 135, 245, 0.6) !important;
  box-shadow:
    0 32px 64px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(66, 135, 245, 0.3) !important;
}

.public-card:hover::after {
  background: radial-gradient(
    circle,
    rgba(66, 135, 245, 0.15) 0%,
    transparent 70%
  );
}

.public-card:hover i {
  filter: drop-shadow(0 6px 24px rgba(66, 135, 245, 0.6)) !important;
}

.public-card:hover h5 {
  color: #4287f5 !important;
}

/* Tarjetas Internas - Acento Dorado */
.internal-card {
  border-color: rgba(212, 175, 55, 0.25) !important;
}

.internal-card i {
  color: #d4af37 !important;
  filter: drop-shadow(0 4px 16px rgba(212, 175, 55, 0.3)) !important;
}

.internal-card:hover {
  border-color: rgba(212, 175, 55, 0.6) !important;
  box-shadow:
    0 32px 64px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(212, 175, 55, 0.3) !important;
}

.internal-card:hover::after {
  background: radial-gradient(
    circle,
    rgba(212, 175, 55, 0.15) 0%,
    transparent 70%
  );
}

.internal-card:hover i {
  filter: drop-shadow(0 6px 24px rgba(212, 175, 55, 0.6)) !important;
}

.internal-card:hover h5 {
  color: #d4af37 !important;
}

/* ========== BADGES ========== */
.card-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  z-index: 10;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.public-badge {
  background: linear-gradient(135deg, 
    rgba(66, 135, 245, 0.9) 0%, 
    rgba(37, 99, 235, 0.9) 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.internal-badge {
  background: linear-gradient(135deg, 
    rgba(212, 175, 55, 0.95) 0%, 
    rgba(184, 148, 31, 0.95) 100%);
  color: #000;
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-weight: 800;
}

.card-dashboard:hover .card-badge {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ========== MODALES ========== */
.modal-content {
  background: linear-gradient(145deg, 
    rgba(17, 17, 17, 0.98) 0%, 
    rgba(26, 26, 26, 0.98) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff;
  border-radius: 24px;
  border: 2px solid rgba(212, 175, 55, 0.3);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(212, 175, 55, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  padding: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-content:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 24px 70px rgba(0, 0, 0, 0.6),
    0 0 50px rgba(212, 175, 55, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.modal-header {
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, 
    rgba(212, 175, 55, 0.05) 0%, 
    transparent 100%);
}

.modal-header h5 {
  color: #d4af37;
  font-weight: 700;
  text-align: center;
  width: 100%;
  font-size: 1.3rem;
  letter-spacing: 1px;
  text-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.modal-header h5 i {
  margin-right: 10px;
  filter: drop-shadow(0 2px 8px rgba(212, 175, 55, 0.4));
}

.btn-close {
  filter: invert(1) brightness(1.2);
  opacity: 0.8;
  transition: all 0.3s ease;
}

.btn-close:hover {
  opacity: 1;
  transform: rotate(90deg);
}

.modal-body {
  padding: 2.5rem;
}

.form-label {
  color: #d4af37;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.form-control {
  background: rgba(34, 34, 34, 0.8);
  color: #fff;
  border: 1px solid rgba(85, 85, 85, 0.5);
  border-radius: 12px;
  padding: 12px 16px;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.form-control:focus {
  border-color: #d4af37;
  box-shadow: 
    0 0 0 3px rgba(212, 175, 55, 0.15),
    0 4px 12px rgba(212, 175, 55, 0.2);
  background: rgba(34, 34, 34, 0.95);
  color: #fff;
  outline: none;
}

.input-group .btn-outline-secondary {
  background: rgba(34, 34, 34, 0.8);
  border: 1px solid rgba(85, 85, 85, 0.5);
  border-left: none;
  color: #d4af37;
  border-radius: 0 12px 12px 0;
  transition: all 0.3s ease;
}

.input-group .btn-outline-secondary:hover {
  background: rgba(212, 175, 55, 0.1);
  color: #d4af37;
  border-color: rgba(85, 85, 85, 0.5);
}

.btn-login {
  background: linear-gradient(135deg, #d4af37 0%, #b8941f 100%);
  color: #000;
  font-weight: 700;
  border-radius: 12px;
  padding: 14px 20px;
  margin-top: 10px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: none;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.95rem;
  box-shadow: 
    0 4px 16px rgba(212, 175, 55, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-login:hover {
  background: linear-gradient(135deg, #f4d47c 0%, #d4af37 100%);
  color: #000;
  transform: translateY(-3px);
  box-shadow: 
    0 8px 24px rgba(212, 175, 55, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-login:active {
  transform: translateY(-1px);
}

/* Animación del modal */
.modal-dialog {
  max-width: 440px;
  margin: 1.75rem auto;
}

.modal.fade .modal-dialog {
  transform: translateY(-50px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.show .modal-dialog {
  transform: translateY(0) scale(1);
}

/* ========== FOOTER ========== */
footer {
  background: linear-gradient(135deg, #0a0a0a 0%, #111 100%);
  color: #999;
  text-align: center;
  padding: 20px 0;
  border-top: 1px solid rgba(212, 175, 55, 0.1);
  position: relative;
  z-index: 1;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

footer .footer-link {
  color: #d4af37;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 600;
}

footer .footer-link:hover {
  color: #f4d47c;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
    margin-bottom: 30px;
    letter-spacing: 1px;
  }

  .section-header {
    padding: 1.8rem 1.5rem;
  }

  .section-header i {
    font-size: 2.2rem;
    margin-right: 0.8rem;
  }

  .section-header h2 {
    font-size: 1.5rem;
    letter-spacing: 2px;
  }

  .section-header p {
    font-size: 0.85rem;
    padding-left: 0;
    margin-top: 0.8rem;
  }

  .card-dashboard {
    height: 240px;
    padding: 40px 25px;
  }

  .card-dashboard i {
    font-size: 3.5rem;
    margin-bottom: 20px;
  }

  .card-dashboard h5 {
    font-size: 1rem;
    letter-spacing: 1.5px;
  }

  .modal-body {
    padding: 1.8rem;
  }

  .card-dashboard:hover {
    transform: translateY(-12px) scale(1.02);
  }
}

@media (max-width: 576px) {
  h1 {
    font-size: 1.6rem;
  }

  .section-header {
    padding: 1.5rem 1rem;
  }

  .section-header i {
    font-size: 1.8rem;
    margin-right: 0.6rem;
  }

  .section-header h2 {
    font-size: 1.2rem;
    letter-spacing: 1.5px;
  }

  .section-header p {
    font-size: 0.8rem;
  }

  .card-dashboard {
    height: 220px;
    padding: 35px 20px;
  }

  .card-dashboard i {
    font-size: 3rem;
  }

  .card-dashboard h5 {
    font-size: 0.95rem;
  }

  .card-badge {
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    font-size: 0.65rem;
    letter-spacing: 1px;
  }

  .modal-dialog {
    max-width: 90%;
  }

  .modal-body {
    padding: 1.5rem;
  }
}

/* Mejoras para tablets */
@media (min-width: 768px) and (max-width: 991px) {
  .section-header {
    padding: 2rem 2rem;
  }

  .section-header i {
    font-size: 2.5rem;
  }

  .section-header h2 {
    font-size: 1.8rem;
  }

  .card-dashboard {
    height: 260px;
  }
}

/* ========== MODAL REGISTRO DE RESIDENTES (AZUL) ========== */
#loginModalResidentes .modal-content {
  background: linear-gradient(145deg, 
    rgba(17, 17, 17, 0.98) 0%, 
    rgba(26, 26, 26, 0.98) 100%);
  border: 2px solid rgba(66, 135, 245, 0.4);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(66, 135, 245, 0.3),
    inset 0 1px 0 rgba(66, 135, 245, 0.1);
}

#loginModalResidentes .modal-content:hover {
  box-shadow: 
    0 24px 70px rgba(0, 0, 0, 0.6),
    0 0 50px rgba(66, 135, 245, 0.4),
    inset 0 1px 0 rgba(66, 135, 245, 0.15);
}

#loginModalResidentes .modal-header {
  border-bottom: 1px solid rgba(66, 135, 245, 0.3);
  background: linear-gradient(135deg, 
    rgba(66, 135, 245, 0.08) 0%, 
    transparent 100%);
}

#loginModalResidentes .modal-header h5 {
  color: #4287f5;
  text-shadow: 0 2px 8px rgba(66, 135, 245, 0.4);
}

#loginModalResidentes .modal-header h5 i {
  filter: drop-shadow(0 2px 8px rgba(66, 135, 245, 0.5));
}

#loginModalResidentes .form-label {
  color: #4287f5;
}

#loginModalResidentes .form-control:focus {
  border-color: #4287f5;
  box-shadow: 
    0 0 0 3px rgba(66, 135, 245, 0.15),
    0 4px 12px rgba(66, 135, 245, 0.25);
}

#loginModalResidentes .input-group .btn-outline-secondary {
  color: #4287f5;
}

#loginModalResidentes .input-group .btn-outline-secondary:hover {
  background: rgba(66, 135, 245, 0.1);
  color: #4287f5;
}

#loginModalResidentes .btn-login {
  background: linear-gradient(135deg, #4287f5 0%, #2563eb 100%);
  color: #fff;
  box-shadow: 
    0 4px 16px rgba(66, 135, 245, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#loginModalResidentes .btn-login:hover {
  background: linear-gradient(135deg, #5a9af7 0%, #4287f5 100%);
  color: #fff;
  box-shadow: 
    0 8px 24px rgba(66, 135, 245, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

