/* Variables de color */
:root {
  --primary-blue: #7EC8E3;
  --secondary-blue: #5CB8D4;
  --dark-blue: #1A6F8B;
  --light-blue: #C4E7F5;
  --bg-color: #F0F9FC;
  --white: #FFFFFF;
  --text-dark: #1A3E4C;
  --text-light: #F0F9FC;
  --shadow: 0 4px 12px rgba(92, 184, 212, 0.2);
}

/* Reset y base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Open Sans', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-dark);
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: 'Roboto', sans-serif;
  font-weight: 600;
  color: var(--dark-blue);
}

a {
  text-decoration: none;
  color: inherit;
}

/* Header */
.header-modern {
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  padding: 1rem 2rem;
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
  border-bottom: 3px solid var(--dark-blue);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  height: 60px;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.site-title {
  color: var(--white);
  font-size: 1.8rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.main-nav {
  display: flex;
  gap: 1.5rem;
}

.main-nav a {
  color: var(--white);
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: 30px;
  transition: all 0.3s ease;
  font-size: 1rem;
  background-color: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(5px);
}

.main-nav a:hover {
  background-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(26, 111, 139, 0.2);
}

/* Hero Carousel */
.hero-carousel {
  position: relative;
  width: 100%;
  height: 80vh; /* Altura del 80% de la ventana, puedes ajustarlo */
  overflow: hidden; /* Oculta las partes de las imágenes que se salen */
  background-color: #fcfbfb; /* Color de fondo mientras cargan las imágenes */
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: contain; /* Cubre todo el espacio sin deformar */
  background-position: center center; /* Centra la imagen */
  background-repeat: no-repeat; /* No repite la imagen */
  opacity: 0;
  transition: opacity 1.5s ease-in-out; /* Transición suave de opacidad */
}

.carousel-slide.active {
  opacity: 1; /* Hace visible la diapositiva activa */
}

/* ✅ RUTAS DE IMAGEN CORREGIDAS: Usamos rutas relativas que funcionan con asset() */
.slide1 { background-image: url('../img/slide1.jpg'); }
.slide2 { background-image: url('../img/slide2.jpg'); }
.slide3 { background-image: url('../img/slide3.jpg'); }


.hero-text {
  /* ... (tus estilos para .hero-text se quedan igual) ... */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  text-align: center;
  background-color: rgba(0, 0, 0, 0.5); /* Fondo semitransparente para legibilidad */
  padding: 2rem;
  border-radius: 10px;
}


@keyframes fadeCarousel {
  0%, 100% { opacity: 0; }
  5%, 30% { opacity: 1; }
  35%, 95% { opacity: 0; }
}



.hero-text h2 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

.hero-text p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.btn-primary {
  background-color: var(--dark-blue);
  color: var(--white);
  padding: 0.9rem 2rem;
  border: none;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 8px rgba(26, 111, 139, 0.3);
  display: inline-block;
}

.btn-primary:hover {
  background-color: #134d62;
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(26, 111, 139, 0.4);
}

/* Servicios */
.services {
  background-color: var(--white);
  padding: 4rem 2rem;
  text-align: center;
}

.services h2 {
  color: var(--dark-blue);
  font-size: 2.2rem;
  margin-bottom: 3rem;
  position: relative;
}

.services h2::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: var(--primary-blue);
  margin: 1rem auto;
  border-radius: 2px;
}

.service-cards {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.card {
  background-color: var(--white);
  border-radius: 12px;
  padding: 2rem;
  width: 320px;
  box-shadow: 0 4px 12px rgba(126, 200, 227, 0.2);
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid var(--light-blue);
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 8px 24px rgba(126, 200, 227, 0.3);
}

.card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.card h3 {
  color: var(--dark-blue);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.card p {
  color: var(--text-dark);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Galería */
.gallery-modern {
  padding: 4rem 2rem;
  background-color: var(--bg-color);
  text-align: center;
}

.gallery-modern h2 {
  color: var(--dark-blue);
  font-size: 2.2rem;
  margin-bottom: 3rem;
  position: relative;
}

.gallery-modern h2::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: var(--primary-blue);
  margin: 1rem auto;
  border-radius: 2px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-item {
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(126, 200, 227, 0.2);
  transition: all 0.3s ease;
  height: 250px;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(126, 200, 227, 0.3);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* Footer */
.footer-modern {
  background: linear-gradient(135deg, var(--dark-blue), #134d62);
  color: var(--text-light);
  padding: 3rem 2rem 1rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-logo {
  width: 180px;
  margin-bottom: 1rem;
}

.footer-links h4, 
.footer-partners h4, 
.footer-map h4 {
  color: var(--primary-blue);
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

.footer-links ul, 
.footer-partners ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.footer-links a {
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--primary-blue);
}

.footer-map iframe {
  width: 100%;
  height: 200px;
  border: none;
  border-radius: 8px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.9rem;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  color: var(--white);
  font-size: 1.2rem;
  transition: color 0.3s ease;
}

.social-links a:hover {
  color: var(--primary-blue);
}

/* Responsive */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    padding: 1rem;
  }

  .main-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
  }

  .hero-text h2 {
    font-size: 2rem;
  }

  .hero-text p {
    font-size: 1rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .service-cards {
    flex-direction: column;
    align-items: center;
  }

  .card {
    width: 100%;
    max-width: 320px;
  }
}

/* Modal Login */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.5);
  backdrop-filter: blur(3px);
}

.modal-content {
    background: rgba(36, 42, 51, 0.75); 
  margin: 8% auto;
  padding: 2rem;
   border: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  max-width: 420px;
  border-radius: 12px;
  position: relative;
  animation: fadeIn 0.4s ease-in-out;
  box-shadow: var(--shadow);
}

.close {
  color: var(--dark-blue);
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: var(--primary-blue);
}

/* Login Box */
.login-box h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--dark-blue);
}

.login-box form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  width: 100%;
  max-width: 320px;
}

.login-box label {
  font-weight: 600;
  color: var(--dark-blue);
}

.login-box input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 1rem 0.75rem 38px; /* si usas icono a la izquierda, mantén este padding */
  border: 1.5px solid var(--light-blue);
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s ease;
  position: relative;
  z-index: 1;
}

.login-box input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 6px var(--primary-blue);
}

.login-box button {
  background-color: var(--dark-blue);
  color: var(--white);
  padding: 0.9rem 2rem;
  border: none;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 1rem;
}

.login-box button:hover {
  background-color: #134d62;
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(26, 111, 139, 0.4);
}

.login-info {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--dark-blue);
}

.login-info a {
  color: var(--primary-blue);
  font-weight: 600;
}

.login-info a:hover {
  text-decoration: underline;
}

/* Animación de fadeIn */
@keyframes fadeIn {
  from {opacity: 0;}
  to {opacity: 1;}
}
.form-error {
  font-size: 0.9rem;
  color: red;
  margin-top: -0.5rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

/* Contenedor de input con ícono a la izquierda (usuario) */
.input-icon {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin-bottom: 0.6rem;
}

.input-icon i.icon-left {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  color: #1A6F8B;
  font-size: 1.1rem;
  pointer-events: none;
  z-index: 10;
}

.input-icon input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 38px; /* espacio para ícono a la izquierda */
  border: 1.5px solid #C4E7F5;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s ease;
}

.input-error {
  border-color: #e63946 !important;
}


.password-container input {
  padding-right: 42px; /* espacio para ojo */
  padding-left: 38px;  /* espacio para icono izquierda */
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--dark-blue);
  font-size: 1.2rem;
  user-select: none;
  z-index: 2;
}


.toggle-password:hover {
  color: var(--primary-blue);
}

.input-icon .error-message {
  display: block;
  margin-top: 4px;
  color: #e63946;
  font-size: 0.85rem;
  padding-left: 10px; /* para alinear con el texto del input */
}

/* Mensajes de error */
/* Estilo del mensaje de error justo debajo del input */
.error-message {
  color: #e63946;
  font-size: 0.85rem;
  margin-top: 4px;
  padding-left: 38px;
  display: block;
 
}


/* Botón Acceder con spinner */
.btn-primary {
  background-color: var(--dark-blue);
  color: var(--white);
  padding: 0.9rem 2rem;
  border: none;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
}

.btn-primary:hover {
  background-color: #134d62;
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(26, 111, 139, 0.4);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.spinner {
  font-size: 1.2rem;
  color: var(--white);
  display: none; /* se muestra desde JS */
}

/* Ajustes para accesibilidad */
.toggle-password:focus {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

/* Eliminar icono por defecto del navegador (ojito negro) */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input[type="password"]::-webkit-credentials-auto-fill-button {
  display: none !important;
}

input[type="password"]::-webkit-input-decoration {
  display: none !important;
}

.services-modern {
  padding: 5rem 2rem;
  background-color: var(--white);
  text-align: center;
}

.services-modern h2 {
  color: var(--dark-blue);
  font-size: 2.4rem;
  margin-bottom: 3rem;
  position: relative;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.services-modern h2::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: var(--primary-blue);
  margin: 1rem auto 0;
  border-radius: 4px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.service-card {
  background-color: var(--bg-color);
  border-radius: 20px;
  box-shadow: 0 8px 20px rgba(126, 200, 227, 0.25);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  border: 1.5px solid var(--light-blue);
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 12px 30px rgba(126, 200, 227, 0.3);
}

.service-card .image-box {
  width: 100%;
  height: 180px;
  overflow: hidden;
  border-radius: 14px;
  margin-bottom: 1.5rem;
}

.service-card .image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.service-card:hover .image-box img {
  transform: scale(1.05);
}

.service-card h3 {
  font-size: 1.4rem;
  color: var(--dark-blue);
  margin-bottom: 0.75rem;
}

.service-card p {
  font-size: 1rem;
  color: var(--text-dark);
  line-height: 1.5;
}

/* ENCABEZADO MODERNO SAN PATRICIO */
.encabezado-hospital {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: white;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.contenedor-logo-titulo {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo-hospital {
  height: 60px;
  width: auto;
}

.texto-hospital h1 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 28px;
  margin: 0;
  line-height: 1;
}

.texto-hospital .san {
  color: #00A0C6;
}

.texto-hospital .patricio {
  color: #002D72;
}

.subtitulo {
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: #00A0C6;
  margin: 2px 0 0 0;
  letter-spacing: 2px;
}

/* Ajuste para navegación del login */
.main-nav a {
  color: #002D72;
  font-weight: bold;
  background-color: #91cae0;
  padding: 8px 16px;
  border-radius: 20px;
  transition: all 0.3s;
}

.main-nav a:hover {
  background-color: #038aac;
  color: white;
}

@media (max-width: 600px) {
  .encabezado-hospital {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 10px;
  }

  .contenedor-logo-titulo {
    flex-direction: row;
    gap: 10px;
  }

  .logo-hospital {
    height: 40px;
  }

  .texto-hospital h1 {
    font-size: 20px;
  }

  .subtitulo {
    font-size: 12px;
    letter-spacing: 1px;
  }
}

main, section.hero-carousel {
  margin-top: 90px;
}

