/* ===== Variables ===== */
:root {
  --color-bg: #0a0e17;
  --color-bg-card: #111827;
  --color-bg-elevated: #1a2234;
  --color-text: #e5e7eb;
  --color-text-muted: #9ca3af;
  --color-accent: #10b981;
  --color-accent-hover: #34d399;
  --color-border: rgba(255, 255, 255, 0.08);
  --font-sans: 'Outfit', 'DM Sans', system-ui, sans-serif;
  --font-display: 'Outfit', system-ui, sans-serif;
  --container: min(1120px, 92vw);
  --header-h: 72px;
  --section-padding: clamp(4rem, 10vw, 6rem);
}

/* ===== Reset y base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-hover); }

/* ===== Overlay En Construcción ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 23, 0.95);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.overlay.is-open {
  opacity: 1;
  visibility: visible;
}
.overlay-content {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 2.5rem;
  max-width: 420px;
  text-align: center;
}
.overlay-icon { font-size: 3rem; margin-bottom: 1rem; }
.overlay-content h2 { margin: 0 0 0.75rem; font-size: 1.5rem; }
.overlay-content p { color: var(--color-text-muted); margin: 0 0 1.5rem; }

/* ===== Botón volver arriba ===== */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 90;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  color: #0a0e17;
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s, visibility 0.25s, transform 0.25s, background 0.2s;
}
.back-to-top:hover {
  background: var(--color-accent-hover);
  transform: translateY(-2px);
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  padding: 0.25rem 0;
}
.logo img {
  height: 52px;
  width: auto;
  max-height: 56px;
  object-fit: contain;
  display: block;
}
.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav a {
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.9375rem;
  transition: color 0.2s;
}
.nav a:hover { color: var(--color-text); }
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  position: relative;
}
.nav-toggle::before,
.nav-toggle::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
}
.nav-toggle::before { top: 12px; }
.nav-toggle::after { bottom: 12px; }

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.btn-primary {
  background: var(--color-accent);
  color: #0a0e17;
}
.btn-primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
}
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover {
  background: var(--color-bg-elevated);
  border-color: var(--color-text-muted);
}
.btn-acceso {
  color: var(--color-accent);
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.btn-acceso:hover {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-accent-hover);
  border-color: var(--color-accent);
}
.btn-block { width: 100%; }

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-h) + 2rem) 1.5rem 4rem;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
}
.hero-bg-image {
  position: absolute;
  inset: 0;
  background: url('https://images.unsplash.com/photo-1569336415962-a4bd9f69cd83?w=1920&q=80') center/cover no-repeat;
  opacity: 0.35;
}
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(16, 185, 129, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 185, 129, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}
.hero-bg-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--color-bg) 0%, transparent 45%, var(--color-bg) 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  text-align: center;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 1.25rem;
  letter-spacing: -0.02em;
}
.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--color-text-muted);
  margin: 0 0 2rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Secciones genéricas ===== */
.section {
  padding: var(--section-padding) 1.5rem;
  position: relative;
}
.container {
  max-width: var(--container);
  margin: 0 auto;
}
.container-narrow { max-width: 520px; }
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}
.section-intro,
.section-tagline {
  color: var(--color-text-muted);
  font-size: 1.0625rem;
  margin: 0 0 2.5rem;
}
.section-tagline { font-size: 1.125rem; margin-bottom: 1.5rem; }

/* ===== Soluciones (cards) ===== */
.soluciones { background: var(--color-bg); }
.soluciones .section-title { text-align: center; }
.soluciones .section-intro { text-align: center; }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 2rem;
  transition: border-color 0.2s, transform 0.2s;
}
.card:hover {
  border-color: rgba(16, 185, 129, 0.3);
  transform: translateY(-2px);
}
.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 1rem;
  color: var(--color-accent);
  background: rgba(16, 185, 129, 0.1);
  border-radius: 12px;
}
.card-icon svg {
  flex-shrink: 0;
}
.card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}
.card p {
  color: var(--color-text-muted);
  margin: 0;
  font-size: 0.9375rem;
}

/* ===== Por qué Flotix ===== */
.por-que {
  background: var(--color-bg-card);
}
.por-que-bg {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(16, 185, 129, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, transparent 0%, var(--color-bg) 100%);
  pointer-events: none;
}
.por-que .container { position: relative; }
.por-que-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.por-que-header-text { flex: 1; min-width: 280px; }
.por-que-brand-visual {
  flex-shrink: 0;
}
.por-que-brand-visual img {
  width: 140px;
  height: auto;
  max-width: 180px;
  border-radius: 12px;
  display: block;
}
@media (max-width: 600px) {
  .por-que-header { flex-direction: column; align-items: center; }
  .por-que-brand-visual img { width: 120px; }
}
.por-que-text {
  color: var(--color-text-muted);
  margin: 0 0 2rem;
  max-width: 640px;
}
.value-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.value-list li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
}
.value-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  color: var(--color-accent);
}
.value-icon svg { flex-shrink: 0; }
.value-list strong { color: var(--color-text); }
.value-list div { color: var(--color-text-muted); font-size: 0.9375rem; }

/* ===== Industrias ===== */
.industrias {
  background: var(--color-bg);
  position: relative;
}
.industrias-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(16, 185, 129, 0.04) 0%, transparent 50%),
    linear-gradient(270deg, rgba(16, 185, 129, 0.04) 0%, transparent 50%);
  pointer-events: none;
}
.industrias .container { position: relative; }
.industrias .section-title { text-align: center; }
.industrias .section-intro { text-align: center; }
.industrias-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.industrias-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  font-weight: 500;
}
.industria-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  color: var(--color-accent);
}
.industria-icon svg { flex-shrink: 0; }

/* ===== Contacto / Formulario ===== */
.contacto { background: var(--color-bg-card); }
.form-contacto {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.form-row label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
}
.form-row input,
.form-row textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  transition: border-color 0.2s;
}
.form-row input::placeholder,
.form-row textarea::placeholder { color: var(--color-text-muted); opacity: 0.8; }
.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* ===== Footer ===== */
.footer {
  padding: 3rem 1.5rem 2rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}
.footer-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2rem;
}
.footer-brand img {
  height: 44px;
  width: auto;
  object-fit: contain;
  display: block;
}
.footer-info p { margin: 0 0 0.5rem; color: var(--color-text-muted); font-size: 0.9375rem; }
.footer-info a { color: var(--color-accent); }
.footer-legal {
  display: flex;
  gap: 1.5rem;
}
.footer-legal a {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}
.footer-legal a:hover { color: var(--color-text); }
.footer-copy {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  margin: 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--color-bg-elevated);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    transform: translateY(-100%);
    visibility: hidden;
    transition: transform 0.3s, visibility 0.3s;
  }
  .nav.is-open {
    transform: translateY(0);
    visibility: visible;
  }
  .nav-toggle { display: block; }
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-legal { justify-content: center; }
}

@media (max-width: 600px) {
  .hero-bg-image {
    background-image: url('https://images.unsplash.com/photo-1569336415962-a4bd9f69cd83?w=800&q=75');
  }
}
