:root{
  --dark:#0D3B45;
  --accent:#2EB6B3;
  --accent-dark:#1FA6A3;
  --text:#1f1f1f;
  --muted:#6e6e6e;
  --ok:#45b35f;
  --card:#e9e9e9;
  --shadow:0 18px 50px rgba(0,0,0,.18);
  --radius:18px;
  --radius-sm:12px;
}

/* ================= RESET ================= */
*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

html{
  scroll-behavior:smooth;
}

body{
  font-family:'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background:#f8f9fa;
  line-height:1.6;
  overflow-x:hidden;
}

img{
  max-width:100%;
  display:block;
}

a{
  color:inherit;
}

button,
input,
select,
textarea{
  font:inherit;
}

/* ================= HEADER CORREGIDO ================= */

.nav{
  background:#15545c;
  padding:14px 0;
  position:relative;
  z-index:2000;
}

.nav__container{
  max-width:1200px;
  margin:0 auto;
  padding:0 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:28px;
  position:relative;
}

.nav__logo{
  display:flex;
  align-items:center;
  flex:0 0 auto;
  position:relative;
  z-index:2100;
  text-decoration:none;
}

.nav__logo img{
  height:58px;
  width:auto;
  max-width:none;
  display:block;
  object-fit:contain;
}

/* bloque central */
.nav__links{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:34px;
  flex:1 1 auto;
  min-width:0;
}

.nav__link{
  color:#fff;
  text-decoration:none;
  font-weight:600;
  font-size:16px;
  line-height:1;
  background:none;
  border:none;
  cursor:pointer;
  font-family:inherit;
  display:inline-flex;
  align-items:center;
  gap:6px;
  transition:opacity .25s ease, background .25s ease, color .25s ease;
  white-space:nowrap;
  padding:4px 0;
}

.nav__link:hover{
  opacity:.85;
}

.nav__link.is-active{
  border-bottom:2px solid #7bd6d0;
  padding-bottom:8px;
}

/* bloque derecho */
.nav__actions{
  display:flex;
  align-items:center;
  gap:18px;
  flex:0 0 auto;
}

.nav__login{
  color:#fff;
  text-decoration:none;
  font-weight:600;
  line-height:1.2;
  transition:opacity .25s ease;
}

.nav__login:hover{
  opacity:.85;
}

.nav__btn{
  background:#36c7c3;
  color:#fff;
  padding:12px 24px;
  border-radius:999px;
  text-decoration:none;
  font-weight:600;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition:background .25s ease, transform .25s ease;
  white-space:nowrap;
}

.nav__btn:hover{
  background:#2bb6b2;
  transform:translateY(-1px);
}

/* ================= DROPDOWN ================= */

.nav__dropdown{
  position:relative;
  display:flex;
  align-items:center;
}

.nav__langbtn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  background:none;
  border:none;
  color:#eaf6f7;
  cursor:pointer;
  font-size:16px;
  padding:4px 0;
  line-height:1;
}

.nav__world{
  font-size:18px;
  line-height:1;
}

.nav__arrow{
  font-size:12px;
  transition:transform .2s ease;
  line-height:1;
}

.nav__dropdown.is-open .nav__arrow{
  transform:rotate(180deg);
}

.nav__dropmenu{
  display:none;
  position:absolute;
  top:calc(100% + 10px);
  left:0;
  background:#0c3c45;
  border:1px solid rgba(255,255,255,0.12);
  border-radius:12px;
  padding:8px;
  min-width:160px;
  z-index:3000;
  box-shadow:var(--shadow);
}

.nav__dropmenu a,
.lang-item{
  display:block;
  width:100%;
  color:#eaf6f7;
  text-decoration:none;
  padding:10px 12px;
  border-radius:10px;
  font-size:15px;
  background:transparent;
  border:none;
  text-align:left;
  cursor:pointer;
}

.nav__dropmenu a:hover,
.lang-item:hover{
  background:rgba(255,255,255,0.08);
}

.nav__dropdown.is-open .nav__dropmenu{
  display:block;
}

.nav__dropmenu--right{
  left:auto;
  right:0;
  min-width:160px;
}

/* ================= HAMBURGUESA ================= */

.nav__toggle{
  display:none;
  width:42px;
  height:42px;
  border:none;
  background:transparent;
  cursor:pointer;
  position:relative;
  z-index:3100;
  flex-shrink:0;
}

.nav__toggle span{
  display:block;
  width:28px;
  height:3px;
  margin:6px auto;
  background:#fff;
  border-radius:2px;
  transition:.25s ease;
}

.nav__toggle[aria-expanded="true"] span:nth-child(1){
  transform:translateY(9px) rotate(45deg);
}

.nav__toggle[aria-expanded="true"] span:nth-child(2){
  opacity:0;
}

.nav__toggle[aria-expanded="true"] span:nth-child(3){
  transform:translateY(-9px) rotate(-45deg);
}

/* ================= BANNER ================= */

.banner{
  background-image:
    linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)),
    url('../img/fondo_servicos.jpg');
  background-size:cover;
  background-position:center;
  color:white;
  text-align:center;
  padding:80px 20px;
}

.banner h1{
  font-size:42px;
  font-weight:700;
  margin-bottom:10px;
  text-shadow:0 2px 4px rgba(0,0,0,0.3);
}

.banner p{
  font-size:18px;
  color:#a8e6cf;
  font-weight:300;
}

/* ================= CONTENEDOR ================= */

.contenedor{
  display:flex;
  width:100%;
  max-width:1200px;
  margin:40px auto;
  padding:0 20px;
  gap:40px;
}

/* ================= SIDEBAR ================= */

.sidebar{
  width:280px;
  flex-shrink:0;
  position:sticky;
  top:100px;
  height:fit-content;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.sidebar h3{
  font-size:20px;
  margin-bottom:25px;
  color:var(--dark);
  font-weight:700;
  padding-bottom:10px;
  border-bottom:3px solid var(--accent);
}

.menu-item{
  background:#ffffff;
  padding:16px 20px;
  margin-bottom:8px;
  border-radius:var(--radius-sm);
  font-weight:600;
  cursor:pointer;
  transition:all 0.3s ease;
  user-select:none;
  color:var(--text);
  box-shadow:0 2px 8px rgba(0,0,0,0.08);
  border:1px solid #e0e0e0;
}

.menu-item:hover{
  background:var(--accent);
  color:white;
  transform:translateX(5px);
  box-shadow:0 4px 12px rgba(46, 182, 179, 0.3);
}

.submenu{
  display:none;
  margin-left:15px;
  margin-bottom:10px;
}

.submenu-item{
  background:#f8f9fa;
  padding:12px 16px;
  margin:6px 0;
  border-radius:8px;
  border:1.5px solid #e0e0e0;
  font-size:14px;
  cursor:pointer;
  transition:all 0.3s ease;
  user-select:none;
  color:var(--text);
  line-height:1.4;
}

.submenu-item:hover{
  background:var(--accent);
  color:white;
  border-color:var(--accent);
  transform:translateX(3px);
}

.submenu-item.activo{
  background:var(--accent) !important;
  color:white !important;
  border-color:var(--accent) !important;
  box-shadow:0 4px 12px rgba(46, 182, 179, 0.4);
  font-weight:600;
}

/* ================= MAIN ================= */

main{
  flex:1;
  min-width:0;
}

.servicio-contenido{
  display:none;
  animation:fadeIn 0.4s ease-in-out;
}

.servicio-contenido.activo{
  display:block;
}

@keyframes fadeIn{
  from{ opacity:0; transform:translateY(20px); }
  to{ opacity:1; transform:translateY(0); }
}

/* ================= ESTRUCTURA DE SERVICIOS ================= */

.servicio-header{
  display:flex;
  align-items:center;
  gap:20px;
  margin-bottom:30px;
  padding:30px;
  background:white;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}

.servicio-icono{
  font-size:48px;
  width:80px;
  height:80px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-radius:50%;
  box-shadow:0 8px 20px rgba(46, 182, 179, 0.3);
}

.servicio-titulo-principal h2{
  font-size:32px;
  color:var(--dark);
  margin-bottom:8px;
  font-weight:700;
}

.servicio-subtitulo{
  font-size:16px;
  color:var(--muted);
  font-weight:400;
}

.servicio-descripcion-general{
  background:white;
  padding:25px 30px;
  border-radius:var(--radius-sm);
  margin-bottom:25px;
  border-left:5px solid var(--accent);
  box-shadow:0 2px 10px rgba(0,0,0,0.05);
  font-size:17px;
  line-height:1.7;
  color:var(--text);
}

.servicio-seccion{
  background:white;
  border-radius:var(--radius-sm);
  margin-bottom:25px;
  box-shadow:0 2px 10px rgba(0,0,0,0.05);
  overflow:hidden;
  transition:transform 0.3s ease, box-shadow 0.3s ease;
}

.servicio-seccion:hover{
  transform:translateY(-2px);
  box-shadow:0 8px 25px rgba(0,0,0,0.1);
}

.seccion-header{
  display:flex;
  align-items:center;
  gap:12px;
  padding:20px 25px;
  background:#f8f9fa;
  border-bottom:2px solid #e9ecef;
}

.seccion-icono{
  font-size:24px;
}

.seccion-header h3{
  font-size:20px;
  color:var(--dark);
  margin:0;
  font-weight:600;
}

.seccion-contenido{
  padding:25px;
}

.servicio-seccion.destacado-verde{
  border-left:5px solid var(--ok);
}

.servicio-seccion.destacado-verde .seccion-header{
  background:#d4edda;
  border-bottom-color:#c3e6cb;
}

.servicio-seccion.destacado-amarillo{
  border-left:5px solid #ffc107;
}

.servicio-seccion.destacado-amarillo .seccion-header{
  background:#fff3cd;
  border-bottom-color:#ffeeba;
}

.servicio-seccion.destacado-rojo{
  border-left:5px solid #dc3545;
}

.servicio-seccion.destacado-rojo .seccion-header{
  background:#f8d7da;
  border-bottom-color:#f5c6cb;
}

.servicio-seccion.destacado-naranja{
  border-left:5px solid #fd7e14;
}

.servicio-seccion.destacado-naranja .seccion-header{
  background:#ffe5cc;
  border-bottom-color:#ffd4b3;
}

.servicio-seccion.destacado-azul{
  border-left:5px solid #007bff;
}

.servicio-seccion.destacado-azul .seccion-header{
  background:#cce5ff;
  border-bottom-color:#b3d7ff;
}

.servicio-seccion.en-construccion{
  border-left:5px solid #6c757d;
  opacity:0.9;
}

.servicio-seccion.en-construccion .seccion-header{
  background:#e9ecef;
}

/* ================= TARJETAS ================= */

.tarjetas-formacion{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(200px, 1fr));
  gap:20px;
  margin-bottom:20px;
}

.tarjeta-formacion{
  background:linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius:var(--radius-sm);
  padding:25px 20px;
  text-align:center;
  border:2px solid #e9ecef;
  transition:all 0.3s ease;
}

.tarjeta-formacion:hover{
  transform:translateY(-5px);
  border-color:var(--accent);
  box-shadow:0 10px 25px rgba(46, 182, 179, 0.2);
}

.tarjeta-icono{
  font-size:36px;
  margin-bottom:12px;
}

.tarjeta-texto{
  font-weight:600;
  color:var(--dark);
  font-size:15px;
}

.nota-adicional{
  text-align:center;
  color:var(--muted);
  font-style:italic;
  margin-top:15px;
  font-size:14px;
}

/* ================= LISTAS ================= */

.lista-requisitos{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.requisito-item{
  display:flex;
  align-items:flex-start;
  gap:12px;
  padding:12px 15px;
  background:#f8f9fa;
  border-radius:8px;
  transition:background 0.2s ease;
}

.requisito-item:hover{
  background:#e9ecef;
}

.requisito-check{
  color:var(--ok);
  font-weight:bold;
  font-size:18px;
  flex-shrink:0;
  margin-top:2px;
}

/* ================= FAMILIARES ================= */

.grid-familiares{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(280px, 1fr));
  gap:15px;
}

.familiar-item{
  display:flex;
  align-items:center;
  gap:12px;
  padding:15px 20px;
  background:#f8f9fa;
  border-radius:10px;
  border:2px solid #e9ecef;
  transition:all 0.3s ease;
}

.familiar-item:hover{
  border-color:var(--accent);
  background:white;
  transform:translateX(5px);
}

.familiar-icono{
  font-size:24px;
}

/* ================= CTA ================= */

.cta-grid{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:20px;
  flex-wrap:wrap;
}

.servicio-cta,
.formulario{
  margin-top:50px;
  width:260px;
  padding:22px;
  border-radius:14px;
  text-align:center;
  box-shadow:0 8px 20px rgba(0,0,0,0.08);
  transition:all 0.3s ease;
}

.servicio-cta{
  background:white;
  border:2px solid #0D3B45;
}

.formulario{
  background:#0D3B45;
  color:white;
  border:2px solid white;
}

.servicio-cta:hover,
.formulario:hover{
  transform:translateY(-4px);
  box-shadow:0 12px 30px rgba(0,0,0,0.15);
}

.cta-icon{
  width:70px;
  height:70px;
  margin:0 auto 10px auto;
  border-radius:50%;
  display:flex;
  justify-content:center;
  align-items:center;
  font-size:40px;
}

.servicio-cta .cta-icon{
  background:rgba(13,59,69,0.08);
  color:#0D3B45;
}

.formulario .cta-icon{
  background:rgba(255,255,255,0.15);
  color:white;
}

.cta-texto,
.texto-descarga{
  font-size:14px;
  margin-bottom:14px;
  line-height:1.4;
}

.btn-asesoria{
  background:#0D3B45;
  border:none;
  padding:10px 20px;
  border-radius:25px;
  cursor:pointer;
  color:white;
  font-size:13px;
  font-weight:700;
  transition:all 0.3s ease;
  box-shadow:0 4px 12px rgba(13,59,69,0.4);
  text-transform:uppercase;
}

.btn-asesoria:hover{
  transform:translateY(-3px) scale(1.03);
  box-shadow:0 8px 20px rgba(13,59,69,0.5);
}

.btn-asesoria:active{
  transform:scale(0.96);
  box-shadow:0 3px 8px rgba(13,59,69,0.4);
}

.btn-descargar{
  background:white;
  border:none;
  padding:10px 20px;
  border-radius:25px;
  cursor:pointer;
  color:#0D3B45;
  font-size:13px;
  font-weight:700;
  transition:all 0.3s ease;
  box-shadow:0 4px 12px rgba(46,182,179,0.4);
  text-transform:uppercase;
  text-decoration:none;
  display:inline-block;
}

.btn-descargar:hover{
  color:white;
  border:2px solid white;
  background-color:rgba(46,182,179,0.6);
  transform:translateY(-3px) scale(1.03);
  box-shadow:0 8px 20px rgba(255,255,255,0.6);
}

.btn-descargar:active{
  transform:scale(0.96);
}

/* ================= FOOTER ================= */

.footer{
  background:#0a0a0a;
  color:#fff;
  padding:60px 0 25px;
  margin-top:80px;
}

.footer-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(250px, 1fr));
  gap:40px;
  max-width:1200px;
  margin:0 auto;
  padding:0 20px;
}

.footer-col h4{
  font-size:18px;
  margin-bottom:20px;
  color:var(--accent);
  font-weight:600;
}

.footer-map iframe{
  width:100%;
  height:150px;
  border:none;
  border-radius:12px;
  margin-top:15px;
}

.footer-links,
.footer-contact{
  list-style:none;
  padding:0;
  font-size:14px;
}

.footer-links li,
.footer-contact li{
  margin-bottom:12px;
  display:flex;
  align-items:center;
  gap:8px;
}

.footer-links a{
  color:#fff;
  text-decoration:none;
  transition:color 0.3s ease;
  opacity:0.9;
}

.footer-links a:hover{
  color:var(--accent);
  opacity:1;
}

.footer-accent{
  color:#aaa;
  font-size:14px;
  line-height:1.6;
}

.footer-muted{
  color:#777;
  font-size:13px;
  margin-bottom:15px;
}

.footer-bottom{
  text-align:center;
  padding-top:35px;
  color:var(--accent);
  font-size:14px;
  border-top:1px solid #333;
  margin-top:40px;
  opacity:0.8;
}

/* ================= CHATBOT ================= */

.chatbot{
  position:fixed;
  right:25px;
  bottom:25px;
  z-index:999;
}

.chatbot-fab{
  width:70px;
  height:70px;
  border-radius:50%;
  border:none;
  background:transparent;
  cursor:pointer;
  transition:transform 0.3s ease;
}

.chatbot-fab:hover{
  transform:scale(1.1);
}

.chatbot-fab img{
  width:100%;
  filter:drop-shadow(0 10px 20px rgba(0,0,0,.3));
}

.chatbot-window{
  position:absolute;
  right:0;
  bottom:85px;
  width:360px;
  background:#fff;
  border-radius:20px;
  box-shadow:0 20px 60px rgba(0,0,0,.25);
  overflow:hidden;
  border:1px solid #e0e0e0;
}

.chatbot-header{
  background:var(--dark);
  color:#fff;
  padding:15px 20px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.chatbot-header strong{
  font-size:16px;
}

.chatbot-close{
  border:none;
  background:transparent;
  color:#fff;
  cursor:pointer;
  font-size:20px;
  width:30px;
  height:30px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  transition:background 0.2s ease;
}

.chatbot-close:hover{
  background:rgba(255,255,255,0.2);
}

.chatbot-body{
  padding:20px;
  height:280px;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
  gap:12px;
  background:#f8f9fa;
}

.msg{
  border-radius:15px;
  padding:12px 16px;
  font-size:14px;
  border:1px solid #e0e0e0;
  background:#fff;
  max-width:80%;
  line-height:1.5;
  box-shadow:0 2px 5px rgba(0,0,0,0.05);
}

.msg-bot{
  align-self:flex-start;
  background:#fff;
  border-bottom-left-radius:5px;
}

.msg-user{
  align-self:flex-end;
  background:var(--accent);
  color:white;
  border-color:var(--accent);
  border-bottom-right-radius:5px;
}

.chatbot-form{
  display:flex;
  gap:10px;
  padding:15px 20px;
  border-top:1px solid #e0e0e0;
  background:white;
}

.chatbot-input{
  flex:1;
  border:2px solid #e0e0e0;
  border-radius:25px;
  padding:12px 18px;
  outline:none;
  font-size:14px;
  transition:border-color 0.2s ease;
}

.chatbot-input:focus{
  border-color:var(--accent);
}

.chatbot-send{
  border:none;
  background:var(--accent);
  color:#fff;
  padding:0 25px;
  border-radius:25px;
  cursor:pointer;
  transition:all 0.3s ease;
  font-weight:600;
}

.chatbot-send:hover{
  background:var(--accent-dark);
  transform:scale(1.05);
}

/* ================= RESPONSIVE ================= */

@media (max-width:980px){
  .nav__links{
    gap:18px;
  }

  .nav__actions{
    gap:12px;
  }
}

@media (max-width:968px){
  .contenedor{
    flex-direction:column;
    gap:30px;
  }

  .sidebar{
    width:100%;
    position:static;
    order:2;
  }

  main{
    order:1;
  }

  .servicio-header{
    flex-direction:column;
    text-align:center;
    padding:25px;
  }

  .servicio-icono{
    width:60px;
    height:60px;
    font-size:32px;
  }

  .servicio-titulo-principal h2{
    font-size:24px;
  }

  .tarjetas-formacion{
    grid-template-columns:1fr;
  }

  .grid-familiares{
    grid-template-columns:1fr;
  }

  .servicio-cta,
  .formulario{
    padding:30px 20px;
    width:100%;
    max-width:320px;
  }

  .cta-texto,
  .texto-descarga{
    font-size:18px;
  }
}

@media (max-width:820px){
  .nav{
    padding:12px 0;
  }

  .nav__container{
    padding:0 16px;
  }

  .nav__logo img{
    height:52px;
  }

  .nav__toggle{
    display:block;
    margin-left:auto;
  }

  .nav__links{
    display:none;
    position:absolute;
    top:100%;
    left:12px;
    right:12px;
    background:#15545c;
    border:1px solid rgba(255,255,255,0.15);
    border-radius:16px;
    padding:14px 16px;
    flex-direction:column;
    align-items:stretch;
    gap:10px;
    box-shadow:0 16px 30px rgba(0,0,0,.18);
    z-index:3000;
  }

  .nav__links.is-open{
    display:flex;
  }

  .nav__link{
    width:100%;
    justify-content:space-between;
    text-align:left;
    padding:12px 10px;
    border-radius:10px;
  }

  .nav__link:hover{
    background:rgba(255,255,255,0.08);
    opacity:1;
  }

  .nav__link.is-active{
    border-bottom:none;
    background:rgba(255,255,255,0.08);
    padding-bottom:12px;
  }

  .nav__actions{
    flex-direction:column;
    align-items:stretch;
    gap:10px;
    padding-top:10px;
    margin-top:6px;
    border-top:1px solid rgba(255,255,255,0.15);
    width:100%;
  }

  .nav__btn,
  .nav__login,
  .nav__langbtn{
    width:100%;
    text-align:center;
    justify-content:center;
  }

  .nav__login{
    display:flex;
    align-items:center;
    justify-content:center;
    padding:12px 10px;
    border-radius:10px;
    text-decoration:none;
  }

  .nav__login:hover{
    background:rgba(255,255,255,0.08);
  }

  .nav__btn{
    padding:12px 16px;
  }

  .nav__dropdown{
    width:100%;
    display:block;
  }

  .nav__dropmenu{
    position:static;
    margin-top:6px;
    min-width:auto;
    box-shadow:none;
    border-radius:10px;
  }
}

@media (max-width:768px){
  .cta-grid{
    flex-direction:column;
  }
}

@media (max-width:640px){
  .nav__container{
    gap:12px;
  }

  .nav__logo img{
    height:46px;
  }
}

@media (max-width:480px){
  .banner h1{
    font-size:28px;
  }

  .banner p{
    font-size:16px;
  }

  .seccion-contenido{
    padding:20px 15px;
  }

  .requisito-item{
    padding:10px 12px;
    font-size:14px;
  }

  .chatbot-window{
    width:calc(100vw - 40px);
    right:-10px;
  }
}

@media (max-width:420px){
  .nav__container{
    padding:0 12px;
  }

  .nav__links{
    left:8px;
    right:8px;
    padding:12px;
  }
}