/* ============================================================
   DESIGN SYSTEM — imprimimos3d.es
   Paleta oscura premium. Vanilla CSS. Sin dependencias.
   ============================================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ---- Variables Globales ---- */
:root {
  /* Fondos */
  --bg:           #07090f;
  --bg-2:         #0d1117;
  --surface:      #111827;
  --surface-2:    #1a2236;
  --surface-3:    #1e2d42;

  /* Bordes */
  --border:       rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.15);
  --border-accent:rgba(59, 130, 246, 0.4);

  /* Accent / Brand */
  --accent:       #3b82f6;
  --accent-light: #60a5fa;
  --accent-dark:  #1d4ed8;
  --accent-glow:  rgba(59, 130, 246, 0.25);

  /* Texto */
  --text:         #f1f5f9;
  --text-muted:   #94a3b8;
  --text-faint:   #475569;

  /* Estado */
  --success:      #22c55e;
  --success-bg:   rgba(34, 197, 94, 0.1);
  --warning:      #f59e0b;
  --warning-bg:   rgba(245, 158, 11, 0.1);
  --danger:       #ef4444;
  --danger-bg:    rgba(239, 68, 68, 0.1);
  --info:         #06b6d4;

  /* Tipografía */
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;

  /* Radios */
  --radius-sm:    6px;
  --radius:       10px;
  --radius-lg:    16px;
  --radius-xl:    24px;
  --radius-full:  9999px;

  /* Sombras */
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.4);
  --shadow:       0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:    0 12px 40px rgba(0,0,0,0.6);
  --shadow-accent:0 4px 24px rgba(59,130,246,0.3);
  --shadow-glow:  0 0 40px rgba(59,130,246,0.15);

  /* Transiciones */
  --transition:   all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --max-width:    1200px;
  --nav-height:   72px;
}

/* ---- Reset Moderno ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

img, video, svg {
  display: block;
  max-width: 100%;
}

input, textarea, select, button {
  font-family: inherit;
}

/* ---- Contenedor ---- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   COMPONENTES COMPARTIDOS
   ============================================================ */

/* ---- Botones ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.925rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: var(--shadow-accent);
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  opacity: 0;
  transition: var(--transition);
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(59,130,246,0.45);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-hover);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: var(--accent-glow);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 16px;
}
.btn-ghost:hover {
  color: var(--text);
  background: var(--surface-2);
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.825rem;
}

/* ---- Navbar Compartido ---- */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--nav-height);
  position: relative;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-logo span.accent { color: var(--accent-light); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}
.nav-links a {
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
}
.nav-links a:hover {
  color: var(--text);
  background: var(--surface-2);
}

/* Hamburguesa móvil */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: calc(var(--nav-height) + 1px);
    left: -24px;
    right: -24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px 20px;
    gap: 4px;
    z-index: 200;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 12px 16px;
    font-size: 1rem;
  }
}

/* ---- Header Sticky ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 9, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease;
}

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: var(--transition);
}
.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card-glass {
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition);
}
.card-glass:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px);
}

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  }
.badge-info    { background: rgba(6,182,212,0.1); color: var(--info);  }
.badge-neutral { background: var(--surface-2); color: var(--text-muted); }

/* ---- Inputs ---- */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}
.input {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--surface-3);
}
.input::placeholder { color: var(--text-faint); }

textarea.input { resize: vertical; min-height: 120px; }

select.input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ---- Secciones ---- */
.section {
  padding: 100px 0;
}
.section-sm {
  padding: 60px 0;
}
.section-title {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
  line-height: 1.15;
}
.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}
.section-header {
  text-align: center;
  margin-bottom: 56px;
}
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-light);
  margin-bottom: 16px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ---- Divisor ---- */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ---- Grid ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .section-title { font-size: 1.75rem; }
}

/* ---- Footer Compartido ---- */
.site-footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 64px 0 32px;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-top: 12px;
  max-width: 280px;
}
.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-faint);
  margin-bottom: 16px;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col ul li a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: var(--transition);
}
.footer-col ul li a:hover {
  color: var(--accent-light);
}
.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.825rem;
  color: var(--text-faint);
  flex-wrap: wrap;
  gap: 12px;
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* ---- Animaciones de Entrada ---- */
.fade-in-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Delays para animaciones escalonadas */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

/* ---- Scrollbar Custom ---- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ---- Utilidades ---- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-light); }
.text-gradient {
  background: linear-gradient(135deg, #fff 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.fw-700 { font-weight: 700; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-8 { margin-bottom: 32px; }
.gap-4 { gap: 16px; }
.gap-8 { gap: 32px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---- Banner de Mantenimiento ---- */
.maintenance-banner {
  display: none;
  background: linear-gradient(90deg, #7f1d1d, #991b1b);
  color: #fff;
  text-align: center;
  padding: 10px 24px;
  font-size: 0.875rem;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 200;
}
.maintenance-banner.visible { display: block; }
