/* ============================================
   CloudNet - Colores corporativos y estilos
   ============================================ */

:root {
  /* Paleta corporativa (tech / nube) */
  --primary: #0c4a6e;
  --primary-dark: #082f49;
  --primary-light: #0ea5e9;
  --accent: #06b6d4;
  --accent-light: #22d3ee;
  --dark: #0f172a;
  --gray: #475569;
  --gray-light: #94a3b8;
  --bg: #f8fafc;
  --white: #ffffff;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.06);
  --radius: 12px;
  --radius-lg: 20px;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--dark);
  background: var(--bg);
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 1.35rem;
}

.logo-img {
  height: 56px;
  width: auto;
  display: block;
}

.logo-text {
  display: none;
}

.logo:has(.logo-img[style*="display: none"]) .logo-text {
  display: inline-block;
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  color: var(--gray);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--primary);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--dark);
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 6rem 0 4rem;
  overflow: hidden;
}

/* Imagen de fondo del hero: ocupa todo, queda bajo el azul */
.hero-image-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-image-wrap .hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  z-index: 1;
  /* Opacidad para que la imagen se note por debajo (0.85 = 85% azul) */
  opacity: 0.92;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 120%, rgba(6, 182, 212, 0.25) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  color: var(--white);
}

.hero-title {
  margin: 0 0 1.25rem;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero-title-line {
  display: block;
}

.hero-title-line.accent {
  color: var(--accent-light);
}

.hero-subtitle {
  margin: 0 0 2rem;
  max-width: 520px;
  font-size: 1.125rem;
  opacity: 0.95;
  color: rgba(255, 255, 255, 0.9);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-primary {
  background: var(--white);
  color: var(--primary);
}

.btn-primary:hover {
  background: var(--accent-light);
  color: var(--primary-dark);
}

.btn-secondary {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.btn-secondary:hover {
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.1);
}

.btn-block {
  width: 100%;
}

.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

/* Sections */
.section {
  padding: 4.5rem 0;
}

.section-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
}

.section-intro {
  margin: 0 0 2.5rem;
  max-width: 560px;
  color: var(--gray);
  font-size: 1.0625rem;
  white-space: nowrap;
}

/* Servicios: tema oscuro corporativo */
.servicios {
  background: var(--primary-dark);
  overflow: visible;
}

.servicios .section-title {
  color: var(--white);
  text-align: center;
}

.servicios .section-intro {
  color: rgba(255, 255, 255, 0.8);
  max-width: none;
  text-align: center;
}

.servicios .container {
  overflow: visible;
}

.servicios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  overflow: visible;
}

.servicio-card {
  position: relative;
  z-index: 1;
  padding: 2rem;
  background: var(--dark);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(14, 165, 233, 0.25);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  overflow: visible;
}

.servicio-card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.15);
}

/* Imágenes por servicio: images/servicio1, servicio2, servicio3 */
.servicio-card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
  background: rgba(14, 165, 233, 0.15);
}

.servicio-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.servicio-card:hover .servicio-card-image img {
  transform: scale(1.03);
}

.servicio-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
}

.servicio-intro {
  margin: 0 0 1rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.servicio-conoce-mas {
  position: relative;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  margin-top: 0.5rem;
  padding: 0.5rem 0;
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary-light);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.servicio-conoce-mas:hover {
  color: var(--accent-light);
}

.servicio-conoce-mas:focus {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

.servicio-conoce-mas::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 0.35rem;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.2s;
}

/* Detalle solo se usa como fuente para el modal; no se muestra inline */
.servicio-detalle {
  display: none !important;
}

/* Cuadro emergente: estilo, animaciones y color */
@keyframes servicio-modal-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes servicio-modal-content-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes servicio-modal-content-out {
  to {
    opacity: 0;
    transform: scale(0.98) translateY(-8px);
  }
}

.servicio-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.servicio-modal[hidden] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.servicio-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 47, 73, 0.5);
  cursor: pointer;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.servicio-modal.is-open .servicio-modal-backdrop {
  opacity: 1;
  animation: servicio-modal-backdrop-in 0.28s ease;
}

.servicio-modal-content {
  position: relative;
  width: 100%;
  max-width: 1100px;
  height: 300px;
  margin: auto;
  padding: 0;
  background: var(--white);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow:
    0 0 0 1px rgba(14, 165, 233, 0.12),
    0 24px 48px rgba(8, 47, 73, 0.18),
    0 12px 24px rgba(0, 0, 0, 0.08);
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.96) translateY(12px);
  transition: opacity 0.28s ease, transform 0.28s ease, box-shadow 0.25s ease;
}

.servicio-modal.is-open .servicio-modal-content {
  opacity: 1;
  transform: scale(1) translateY(0);
  animation: servicio-modal-content-in 0.3s ease;
}

.servicio-modal.is-open .servicio-modal-content:hover {
  box-shadow:
    0 0 0 1px rgba(14, 165, 233, 0.2),
    0 28px 56px rgba(8, 47, 73, 0.22),
    0 14px 28px rgba(0, 0, 0, 0.1);
}

/* Franja superior con gradiente corporativo */
.servicio-modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary) 40%, var(--primary-light) 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.servicio-modal-cerrar {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--gray);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.servicio-modal-cerrar:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(12, 74, 110, 0.3);
}

.servicio-modal-cerrar:active {
  transform: scale(0.98);
}

.servicio-modal-title {
  margin: 0 2.5rem 0 0;
  padding: 1.15rem 2rem 0.4rem 2rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.06) 0%, transparent 60%);
}

.servicio-modal-intro {
  margin: 0 0 0.75rem;
  padding: 0 2rem;
  color: var(--gray);
  font-size: 0.875rem;
  line-height: 1.4;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.servicio-modal-detalle {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem 1rem;
  padding: 0 2rem 1.25rem 2rem;
}

.servicio-modal-detalle .servicio-block {
  padding: 0.6rem 0.85rem;
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.05) 0%, rgba(14, 165, 233, 0.02) 100%);
  border-radius: var(--radius);
  border-left: 3px solid var(--primary-light);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.servicio-modal-detalle .servicio-block:hover {
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.08) 0%, rgba(14, 165, 233, 0.04) 100%);
  border-left-color: var(--primary);
}

.servicio-modal-detalle .servicio-block h4 {
  margin: 0 0 0.3rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.01em;
}

.servicio-modal-detalle .servicio-block ul {
  margin: 0;
  padding-left: 1rem;
  color: var(--gray);
  font-size: 0.75rem;
  line-height: 1.4;
}

.servicio-modal-detalle .servicio-block ul li {
  margin-bottom: 0.1rem;
  transition: color 0.2s ease;
}

.servicio-modal-detalle .servicio-block ul li:last-child {
  margin-bottom: 0;
}

.servicio-modal-detalle .servicio-block:hover ul li {
  color: var(--dark);
}

.servicio-modal-detalle .servicio-block ul li::marker {
  color: var(--primary-light);
}

.servicio-blocks {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.servicio-block h4 {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--primary-light);
}

.servicio-block ul {
  margin: 0;
  padding-left: 1.1rem;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.875rem;
  line-height: 1.55;
}

.servicio-block ul li {
  margin-bottom: 0.25rem;
}

.servicio-block ul li:last-child {
  margin-bottom: 0;
}

.servicio-block ul li::marker {
  color: var(--primary-light);
}

.servicio-card p:not(.servicio-intro) {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9375rem;
}

/* Nosotros: imagen images/nosotros */
.nosotros {
  background: linear-gradient(180deg, var(--bg) 0%, var(--white) 100%);
}

.nosotros-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.nosotros-content {
  max-width: 100%;
}

.nosotros-image-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.nosotros-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.nosotros-text {
  margin: 0 0 1.5rem;
  color: var(--gray);
  font-size: 1.0625rem;
}

.nosotros-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--gray);
}

.nosotros-list li {
  margin-bottom: 0.5rem;
}

.nosotros-list li::marker {
  color: var(--primary-light);
}

/* Contacto: imagen images/contacto */
.contacto {
  background: var(--primary-dark);
  color: var(--white);
}

.contacto-wrap {
  display: block;
  max-width: 900px;
}

.contacto-content {
  max-width: 100%;
  min-width: 0;
}

.contacto-image-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

.contacto-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.contacto .section-title.contacto-form-title {
  color: var(--accent-light);
  text-align: center;
  margin-bottom: 1.5rem;
}

.contacto-form {
  max-width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.5rem;
  align-items: start;
}

.contacto-form .form-row-left { grid-column: 1; }
.contacto-form .form-row-right { grid-column: 2; }
.contacto-form .form-row-full { grid-column: 1 / -1; }

.contacto-form .form-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  min-height: 0;
}

.contacto-form .form-row label {
  display: block;
  margin: 0;
  font-weight: 500;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.95);
}

.contacto-form .form-row .required {
  color: var(--accent);
}

.contacto-form .form-row-full textarea {
  min-height: 120px;
  resize: vertical;
}

.contacto-recaptcha {
  grid-column: 1 / -1;
  margin: 1rem 0 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
}

.contacto-recaptcha a {
  color: var(--accent-light);
  text-decoration: none;
}

.contacto-recaptcha a:hover {
  text-decoration: underline;
}

.contacto-form .contacto-btn-submit {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 0.5rem;
  padding: 0.6rem 1.5rem;
  font-size: 0.9375rem;
  background: var(--accent);
  color: var(--white);
  border: none;
}

.contacto-form .contacto-btn-submit:hover {
  background: var(--accent-light);
  color: var(--primary-dark);
}

.form-row input,
.form-row textarea {
  width: 100%;
  min-width: 0;
  padding: 0.6rem 0.85rem;
  font-family: var(--font);
  font-size: 0.9375rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: rgba(30, 41, 59, 0.6);
  color: var(--white);
  transition: border-color 0.2s, background 0.2s;
  box-sizing: border-box;
}

.form-row input::placeholder,
.form-row textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent-light);
  background: rgba(255, 255, 255, 0.12);
}


/* Footer */
.footer {
  background: var(--dark);
  color: var(--gray-light);
  padding: 0.65rem 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
}

.footer-logo {
  display: block;
  flex-shrink: 0;
}

.footer-logo-img {
  display: block;
  height: 32px;
  width: auto;
  object-fit: contain;
}

.footer-contact {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 0.75rem;
  font-size: 0.75rem;
}

.footer-contact .footer-address::after,
.footer-contact .footer-link:not(:last-child)::after {
  content: " · ";
  margin-left: 0.5rem;
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

.footer-address {
  margin: 0;
}

.footer-contact .footer-link {
  color: var(--gray-light);
  text-decoration: none;
}

.footer-contact .footer-link:hover {
  color: var(--accent-light);
}

.footer-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--gray-light);
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.footer-social-link:hover {
  color: var(--accent-light);
  background: rgba(255, 255, 255, 0.08);
}

.footer-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--white);
  background: #25d366;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s;
}

.footer-whatsapp:hover {
  background: #20bd5a;
  color: var(--white);
}

.footer-copy {
  flex-basis: 100%;
  margin: 0;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.7rem;
  opacity: 0.7;
  text-align: center;
  order: 10;
}

/* Responsive */
@media (max-width: 768px) {
  .nav {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid var(--border);
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }

  .nav a:last-child {
    border-bottom: none;
  }

  .nav-toggle span {
    transition: transform 0.2s, opacity 0.2s;
  }

  .nav-toggle.is-open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle.is-open span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.is-open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    padding: 5rem 0 3rem;
  }

  .nosotros-wrap {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .nosotros-image-wrap {
    order: -1;
  }

  .contacto-form {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    min-height: 0;
    align-items: start;
  }

  .contacto-form .form-row-left,
  .contacto-form .form-row-right,
  .contacto-form .form-row-full,
  .contacto-form .contacto-recaptcha,
  .contacto-form .contacto-btn-submit {
    grid-column: 1;
  }

  .section {
    padding: 3rem 0;
  }

  .servicios-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    justify-content: center;
    text-align: center;
  }

  .footer-logo {
    order: 1;
  }

  .footer-contact {
    order: 2;
    justify-content: center;
    flex-basis: 100%;
  }

  .footer-contact .footer-address::after,
  .footer-contact .footer-link:not(:last-child)::after {
    margin-left: 0.35rem;
  }

  .footer-actions {
    order: 3;
    justify-content: center;
  }

  .footer-copy {
    order: 4;
  }
}
