/*!
 * PILAR EPG - Design System & Modern Responsive Presentation Styles
 * Theme: Executive Academic & Peruvian Fiestas Patrias
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --epg-primary: #9C466A;
  --epg-primary-hover: #833957;
  --epg-primary-dark: #6D2E5A;
  --epg-primary-light: #B1547B;
  --epg-accent-gold: #FFD166;
  --epg-peru-red: #D91023;
  --epg-peru-darkred: #A30B19;
  --epg-dark: #1A1D20;
  --epg-gray-bg: #F4F6F9;
  --epg-card-bg: #FFFFFF;
  --epg-text-dark: #2B2D42;
  --epg-text-muted: #6C757D;
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  font-family: var(--font-body);
  background-color: var(--epg-primary);
  color: var(--epg-text-dark);
  padding-top: 72px;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: var(--font-heading);
}

.bg-purple {
  background-color: #9C466A !important;
}

/* --- Franja Institucional Decorativa --- */
.franja-institucional {
  height: 5px;
  width: 100%;
  background: linear-gradient(90deg, #4b1a38 0%, #9C466A 50%, #4b1a38 100%);
  display: block;
  z-index: 1040;
}

/* --- Responsive Navbar --- */
.navbar-epg {
  background: rgba(156, 70, 106, 0.96) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  padding: 0.75rem 1rem;
}

.navbar-epg .navbar-brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-epg .navbar-brand-img {
  height: 42px;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.navbar-epg .nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 1rem !important;
  border-radius: 8px;
  transition: all 0.25s ease;
  letter-spacing: 0.3px;
}

.navbar-epg .nav-link:hover, 
.navbar-epg .nav-item.active .nav-link {
  color: #FFFFFF !important;
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

/* --- Hero Section --- */
.hero-epg {
  background: #9C466A !important;
  color: white;
  position: relative;
  overflow: hidden;
  padding: 4.5rem 0 5rem;
}

.hero-epg::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-epg::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(217, 16, 35, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* --- Removed Hero Badge Patrio --- */

.hero-title {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  color: #FFFFFF;
  margin-bottom: 1.2rem;
  letter-spacing: -0.5px;
}

.hero-lead {
  font-size: clamp(1rem, 1.8vw, 1.18rem);
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.65;
  max-width: 850px;
  margin-bottom: 2rem;
}

.btn-reglamento {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.96);
  color: #9C466A;
  font-weight: 700;
  padding: 0.85rem 1.8rem;
  border-radius: 50px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  text-decoration: none !important;
  font-size: 0.95rem;
  border: none;
}

.btn-reglamento:hover {
  background: #FFFFFF;
  color: #7A3351;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

/* --- Cards Container Grid --- */
.action-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.75rem;
  margin-top: -2.5rem;
  position: relative;
  z-index: 10;
  margin-bottom: 3.5rem;
}

.action-card {
  background: var(--epg-card-bg);
  border-radius: 16px;
  padding: 2.25rem 1.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none !important;
  position: relative;
  overflow: hidden;
}

.action-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-color, var(--epg-primary));
  transition: height 0.3s ease;
}

.action-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

.action-card:hover::before {
  height: 6px;
}

.action-card .card-icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--card-bg-light, rgba(156, 70, 106, 0.08));
  color: var(--card-color, var(--epg-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.action-card .card-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--epg-text-dark);
  margin-bottom: 0.5rem;
}

.action-card .card-desc {
  font-size: 0.92rem;
  color: var(--epg-text-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.action-card .card-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  background: var(--card-color, var(--epg-primary));
  color: white;
  border: none;
  transition: all 0.25s ease;
}

.action-card:hover .card-action-btn {
  filter: brightness(1.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Card Variations */
.card-ingresar {
  --card-color: #0284C7;
  --card-bg-light: #E0F2FE;
}

.card-registro {
  --card-color: #D97706;
  --card-bg-light: #FEF3C7;
}

.card-sustentaciones {
  --card-color: #9C466A;
  --card-bg-light: #FCE7F3;
}

/* --- Form Cards Standardized Component --- */
.epg-form-wrapper {
  padding: 2.5rem 0;
}

.epg-form-logo-box {
  text-align: center;
  margin-bottom: 1.5rem;
}

.epg-form-logo-box img {
  height: 72px;
  width: auto;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.epg-card-standard {
  background: #FFFFFF !important;
  border-radius: 16px !important;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.28) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  margin: auto;
}

.epg-card-header-banner {
  background: linear-gradient(135deg, #6D2E5A 0%, #9C466A 100%) !important;
  color: #FFFFFF !important;
  padding: 1.35rem 1.5rem;
  text-align: center;
}

.epg-card-header-banner h1, 
.epg-card-header-banner h2, 
.epg-card-header-banner h3 {
  color: #FFFFFF !important;
  font-weight: 800 !important;
  font-size: 1.35rem;
  margin-bottom: 0.2rem;
  letter-spacing: -0.3px;
}

.epg-card-header-banner p {
  color: rgba(255, 255, 255, 0.88) !important;
  font-size: 0.85rem;
  margin: 0;
}

.btn-epg-primary {
  background-color: #9C466A !important;
  border-color: #9C466A !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(156, 70, 106, 0.3);
}

.btn-epg-primary:hover {
  background-color: #833957 !important;
  border-color: #833957 !important;
  color: #FFFFFF !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(156, 70, 106, 0.4);
}

.btn-epg-outline {
  background-color: transparent !important;
  border: 1.5px solid #9C466A !important;
  color: #9C466A !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  transition: all 0.2s ease;
}

.btn-epg-outline:hover, .btn-epg-outline.active {
  background-color: #9C466A !important;
  color: #FFFFFF !important;
}

/* --- Removed Escarapela & Ribbon --- */

/* --- Modal Popup Institucional --- */
#popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 18, 22, 0.75);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  padding: 1rem 0.75rem;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.popup-modal-card {
  background-color: #FFFFFF !important;
  color: #2B2D42 !important;
  border-radius: 14px;
  text-align: left;
  max-width: 520px;
  width: 95%;
  max-height: calc(100vh - 2.2rem);
  display: flex;
  flex-direction: column;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.35);
  font-family: var(--font-body);
  position: relative;
  overflow: hidden;
  transform: translateY(15px) scale(0.98);
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  border: 1px solid rgba(0, 0, 0, 0.08);
  z-index: 100000;
  margin: auto;
}

#popup.show .popup-modal-card {
  transform: translateY(0) scale(1);
}

.popup-header-institucional {
  flex-shrink: 0;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.popup-header-institucional .header-icon-box {
  width: 48px;
  height: 48px;
  background: rgba(156, 70, 106, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--epg-primary);
  flex-shrink: 0;
}

.popup-header-institucional .header-title-box h2 {
  font-size: clamp(1.1rem, 3.5vw, 1.35rem);
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
  color: var(--epg-primary-dark) !important;
  letter-spacing: -0.3px;
}

.popup-header-institucional .header-title-box span {
  font-size: 0.75rem;
  color: var(--epg-text-muted) !important;
  font-weight: 700;
  display: block;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.popup-body-institucional {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.5rem;
  color: var(--epg-text-dark) !important;
  font-size: 0.95rem;
  line-height: 1.6;
  background-color: #FFFFFF !important;
}

.popup-footer-institucional {
  flex-shrink: 0;
  padding: 1rem 1.5rem;
  background-color: #FFFFFF !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.popup-signature {
  font-weight: 600;
  color: var(--epg-text-muted) !important;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-popup-close {
  background: var(--epg-primary);
  color: white !important;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(156, 70, 106, 0.2);
}

.btn-popup-close:hover {
  background: var(--epg-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(156, 70, 106, 0.3);
}

.popup-footer-image {
  flex-shrink: 0;
  width: 100%;
  height: 80px;
  overflow: hidden;
  position: relative;
  background: #E2E8F0;
}

.popup-footer-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 35px;
  background: linear-gradient(to bottom, #FFFFFF 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.popup-footer-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.9;
}

/* Footer Section */
.footer-epg {
  background: var(--epg-dark);
  color: rgba(255, 255, 255, 0.75);
  padding: 2.5rem 0;
  font-size: 0.9rem;
}

.footer-epg a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.footer-epg a:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

/* Mobile Adjustments for framing popup & form cards */
@media (max-width: 576px) {
  body {
    padding-top: 64px;
  }
  .epg-card-standard {
    border-radius: 14px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35) !important;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
  }
  #popup {
    padding: 0.75rem 0.5rem;
  }
  .popup-modal-card {
    max-height: calc(100vh - 1.5rem);
    border-radius: 14px;
  }
  .popup-header-institucional {
    padding: 1rem 1.25rem;
  }
  .popup-body-institucional {
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    line-height: 1.5;
  }
  .popup-footer-institucional {
    padding: 0.85rem 1.25rem;
    flex-direction: row;
    align-items: center;
  }
  .popup-signature {
    font-size: 0.8rem;
  }
  .btn-popup-close {
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
  }
  .popup-footer-image {
    height: 60px;
  }
  .hero-epg {
    padding: 3rem 0 4.5rem;
    text-align: center;
  }
}