@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700&family=Open+Sans:wght@400;600&display=swap');

:root{
  --primary:#001f3f;
  --accent:#00509e;
  --gold:#c5a021;
  --green:#10b981;
  --bg:#f6f8fb;
}

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

body{
  font-family:'Open Sans',sans-serif;
  background:var(--bg);
  color:#1e293b;
}

/* ================= LOADER ================= */
.loader-wrapper{
  position:fixed;
  inset:0;
  background:var(--primary);
  display:flex;
  justify-content:center;
  align-items:center;
  z-index:9999;
}

.loader{
  width:60px;
  height:60px;
  border:6px solid rgba(255,255,255,.2);
  border-top:6px solid var(--gold);
  border-radius:50%;
  animation:spin 1s linear infinite;
}

@keyframes spin{
  to{transform:rotate(360deg)}
}

.loader-hidden{
  display:none;
}

/* ================= HEADER ================= */
header{
  background:var(--primary);
  padding:1rem 6%;
  position:sticky;
  top:0;
  z-index:1000;
}

.nav-container{
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.logo-container{
  display:flex;
  align-items:center;
  gap:10px;
}

.logo{
  width:40px;
  border-radius:6px;
  border:2px solid var(--gold);
}

nav h1{
  color:white;
}

.nav-links{
  list-style:none;
  display:flex;
  gap:20px;
}

.nav-links a{
  color:white;
  text-decoration:none;
  font-weight:600;
}

/* ================= HERO ================= */
.hero-modern{
  position:relative;
  min-height:85vh;
  background:url("https://uepdc.edu.ec/wp-content/uploads/2025/10/544938406_18073068785034051_4074890452089397689_n.jpg")
  center/cover no-repeat;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  padding:0 10%;
  color:white;
  overflow:hidden;
}

.hero-overlay{
  position:absolute;
  inset:0;
  background:rgba(0,31,63,0.65);
  z-index:1;
}

.hero-content{
  position:relative;
  z-index:2;
  max-width:480px;
}

.hero-content h2{
  font-size:3rem;
  font-family:'Montserrat',sans-serif;
  line-height:1.1;
}

.hero-content p{
  margin:20px 0;
}

.hero-shape{
  position:absolute;
  bottom:-1px;
  left:0;
  width:100%;
  height:120px;
  background:white;
  clip-path:polygon(0 60%,100% 0,100% 100%,0 100%);
  z-index:3;
}

/* ================= BOTONES ================= */
.btn-int{
  display:inline-block;
  padding:12px 22px;
  border-radius:10px;
  background:linear-gradient(to right,var(--primary),var(--accent));
  color:white;
  text-decoration:none;
  font-weight:600;
  transition:.3s;
}

.btn-int:hover{
  transform:scale(1.05);
  box-shadow:0 10px 20px rgba(0,0,0,.2);
}

.btn-file{
  background:linear-gradient(to right,#10b981,#34d399);
}

/* ================= STATS ================= */
.stats-container{
  display:flex;
  justify-content:center;
  gap:25px;
  padding:50px 10%;
  flex-wrap:wrap;
}

.stat-box{
  background:white;
  padding:30px;
  width:260px;
  border-radius:18px;
  text-align:center;
  box-shadow:0 10px 25px rgba(0,0,0,.08);
}

.highlight{
  border-left:6px solid var(--gold);
}

/* ================= ABOUT ================= */
.about-section{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:30px;
  padding:60px 10%;
}

.about-box{
  background:white;
  padding:30px;
  border-radius:18px;
  border-left:6px solid var(--gold);
  box-shadow:0 10px 25px rgba(0,0,0,.08);
}

/* ================= ESPECIALIDADES INDEX ================= */
.specialties-cards{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
  gap:30px;
  padding:60px 10%;
}

.spec-image-card{
  background:#0b2a4a;
  border-radius:18px;
  overflow:hidden;
  box-shadow:0 15px 30px rgba(0,0,0,.15);
  transition:.4s;
}

.spec-image-card:hover{
  transform:translateY(-10px);
}

.spec-image-card img{
  width:100%;
  height:240px;
  object-fit:cover;
}

.spec-content{
  padding:25px;
  text-align:center;
  color:white;
}

.spec-content h3{
  font-family:'Montserrat',sans-serif;
  font-size:1.6rem;
  margin-bottom:10px;
  color:#facc15;
}

.spec-content p{
  margin-bottom:20px;
}

.spec-content a{
  display:inline-block;
  padding:10px 20px;
  border-radius:8px;
  background:white;
  color:#0b2a4a;
  font-weight:600;
  text-decoration:none;
  transition:.3s;
}

.spec-content a:hover{
  background:#facc15;
}

/* ================= SECCIONES INTERNAS MEJORADAS ================= */
.section-internal{
  padding:80px 10%;
  background:
    radial-gradient(circle at top, rgba(0,80,158,.05), transparent 60%),
    var(--bg);
}

.projects-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(300px,1fr));
  gap:40px;
}

.card-project{
  background:rgba(255,255,255,.95);
  border-radius:22px;
  padding:28px;
  box-shadow:0 20px 40px rgba(0,0,0,.08);
  transition:.4s;
  position:relative;
  overflow:hidden;
}

.card-project:hover{
  transform:translateY(-15px);
  box-shadow:0 30px 60px rgba(0,0,0,.15);
}

.card-project h3{
  font-family:'Montserrat',sans-serif;
  font-size:1.4rem;
  margin-bottom:12px;
}

.card-project p{
  color:#475569;
  margin-bottom:18px;
}

.card-project::after{
  content:"";
  position:absolute;
  bottom:0;
  left:0;
  width:100%;
  height:4px;
}

.info-border::after{
  background:linear-gradient(to right,#2563eb,#38bdf8);
}

.ciencia-border::after{
  background:linear-gradient(to right,#10b981,#6ee7b7);
}

.conta-border::after{
  background:linear-gradient(to right,#f59e0b,#fde68a);
}

.btn-group{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:center;
}

/* ================= FOOTER ================= */
.footer{
  background:var(--primary);
  color:white;
  text-align:center;
  padding:25px;
  margin-top:60px;
}

/* ================= ANIMACIONES ================= */
.fade-in{
  opacity:0;
  transform:translateY(30px);
  transition:.8s;
}

.fade-in.visible{
  opacity:1;
  transform:none;
}

/* ================= RESPONSIVE ================= */
@media(max-width:768px){
  .hero-modern{
    justify-content:center;
    text-align:center;
    padding:0 6%;
  }

  .hero-content h2{
    font-size:2.2rem;
  }

  .about-section{
    grid-template-columns:1fr;
  }

  .section-internal{
    padding:60px 6%;
  }
}

.project-link{
  color:inherit;
  text-decoration:none;
}
.project-link:hover{
  text-decoration:underline;
}

/* ================= DROPDOWN ESPECIALIDADES ================= */
.dropdown-stat{
  position: relative;
  cursor: pointer;
}

.dropdown-menu{
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,.15);
  display: none;
  overflow: hidden;
  z-index: 20;
}

.dropdown-menu a{
  display: block;
  padding: 14px;
  text-decoration: none;
  color: #0b2a4a;
  font-weight: 600;
  transition: background .3s;
}

.dropdown-menu a:hover{
  background: #facc15;
}

.dropdown-stat.active .dropdown-menu{
  display: block;
}