/* ============================================
   SMARTHAUL AI — SHARED DESIGN SYSTEM
   ============================================ */

/* ---------- RESET / BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0a0a0b;
  color: #e8e8ea;
  min-height: 100vh;
  overflow-x: hidden;
  font-feature-settings: 'ss01', 'cv01';
  letter-spacing: -0.01em;
  display: flex;
  flex-direction: column;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- COLOR TOKENS ---------- */
:root {
  --bg: #0a0a0b;
  --bg-elevated: #111114;
  --bg-elevated-2: #16161a;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e8e8ea;
  --text-muted: #8b8b92;
  --text-dim: #5a5a62;
  --accent: #2b7fff;
  --accent-hover: #4a92ff;
  --accent-glow: rgba(43, 127, 255, 0.4);
  --accent-subtle: rgba(43, 127, 255, 0.08);
  --success: #4ade80;
  --success-subtle: rgba(74, 222, 128, 0.12);
}

/* ---------- AMBIENT BACKGROUND ---------- */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.ambient::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 900px;
  background: radial-gradient(circle, rgba(43, 127, 255, 0.18) 0%, transparent 60%);
  filter: blur(60px);
}
.ambient::after {
  content: '';
  position: absolute;
  bottom: -30%;
  right: -10%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(43, 127, 255, 0.08) 0%, transparent 60%);
  filter: blur(80px);
}
.grid-overlay {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at center top, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center top, black 30%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- CUSTOM COMPONENTS FIX ---------- */
/* Esto obliga al navegador a darles estructura a tus etiquetas personalizadas */
navbar-component, footer-component {
  display: block;
  width: 100%;
  z-index: 40;
}

/* ---------- NAVBAR ---------- */
.nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  width: calc(100% - 40px);
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 12px 24px;
  background: rgba(15, 15, 18, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 100px;
  opacity: 0;
  animation: fadeDown 0.8s 0.1s forwards cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.nav-logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.nav-links {
  display: flex;
  gap: 32px;
  font-size: 14px;
  color: var(--text-muted);
}
.nav-links a { transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-cta {
  padding: 8px 18px;
  background: var(--text);
  color: var(--bg);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  transition: transform 0.2s, background 0.2s;
}
.nav-cta:hover { transform: scale(1.03); background: #fff; }
@media (max-width: 720px) { .nav-links { display: none; } }

/* ---------- PAGE HEADER ---------- */
.page-header {
  position: relative;
  z-index: 1;
  padding: 140px 24px 60px;
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}
.page-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp 0.8s 0.1s forwards cubic-bezier(0.16, 1, 0.3, 1);
}
.page-pill-tag {
  padding: 2px 8px;
  background: var(--accent-subtle);
  color: var(--accent);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.page-header h1 {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp 1s 0.2s forwards cubic-bezier(0.16, 1, 0.3, 1);
}
.page-header h1 em {
  font-style: normal;
  background: linear-gradient(135deg, #2b7fff 0%, #6ba5ff 50%, #2b7fff 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 4s linear infinite;
}
.page-header p.lead {
  font-size: clamp(16px, 1.3vw, 19px);
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.55;
  letter-spacing: -0.01em;
  opacity: 0;
  animation: fadeUp 0.8s 0.35s forwards cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- BUTTONS ---------- */
.btn-glass {
  position: relative;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  background: rgba(43, 127, 255, 0.15);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(43, 127, 255, 0.35);
  border-radius: 100px;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.02) inset,
    0 8px 32px rgba(43, 127, 255, 0.15),
    0 1px 0 rgba(255,255,255,0.1) inset;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.btn-glass::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  opacity: 1;
  transition: opacity 0.3s;
  pointer-events: none;
}
.btn-glass::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -100%;
  width: 60%;
  height: 200%;
  background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,0.25) 50%, transparent 80%);
  transform: skewX(-20deg);
  transition: left 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.btn-glass:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 12px 40px rgba(43, 127, 255, 0.35),
    0 1px 0 rgba(255,255,255,0.15) inset;
}
.btn-glass:hover::after { left: 120%; }
.btn-glass > * { position: relative; z-index: 1; }
.btn-glass .arrow { transition: transform 0.3s; }
.btn-glass:hover .arrow { transform: translateX(3px); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 500;
  background: var(--text);
  color: var(--bg);
  border-radius: 100px;
  transition: transform 0.2s, background 0.2s, box-shadow 0.3s;
  text-decoration: none;
}
.btn-primary:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(255,255,255,0.08);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 100px;
  border: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  text-decoration: none;
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface);
}

/* ---------- CARDS ---------- */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: border-color 0.3s, transform 0.3s;
}
.card-hover:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
}

/* ---------- FIELDS ---------- */
.field { margin-bottom: 20px; }
.field-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'JetBrains Mono', monospace;
}
.field-input, .field-select, .field-textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  transition: border-color 0.2s, background 0.2s;
  line-height: 1.5;
}
.field-textarea {
  resize: vertical;
  min-height: 88px;
}
.field-input:focus, .field-select:focus, .field-textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(43, 127, 255, 0.04);
}
.field-input::placeholder, .field-textarea::placeholder { color: var(--text-dim); }

/* ---------- FOOTER ---------- */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 60px 24px 32px;
  margin-top: auto;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
@media (max-width: 720px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
}
.footer-brand h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;
}
.footer-brand h4::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.footer-brand p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 280px;
}
.footer h5 {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'JetBrains Mono', monospace;
}
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 10px; }
.footer ul a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.2s;
}
.footer ul a:hover { color: var(--text); }
.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim);
}
.footer-bottom .status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
}
.footer-bottom .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
  animation: pulse 2s infinite;
}

/* ---------- UTILITY ---------- */
.section {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.section-narrow { max-width: 680px; }

.mono {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
}

/* ---------- ANIMATIONS ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translate(-50%, -12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes scan {
  0% { top: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
@keyframes shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Stagger helper for entrance animations */
.stagger > * {
  opacity: 0;
  animation: fadeUp 0.8s forwards cubic-bezier(0.16, 1, 0.3, 1);
}
.stagger > *:nth-child(1) { animation-delay: 0.1s; }
.stagger > *:nth-child(2) { animation-delay: 0.2s; }
.stagger > *:nth-child(3) { animation-delay: 0.3s; }
.stagger > *:nth-child(4) { animation-delay: 0.4s; }
.stagger > *:nth-child(5) { animation-delay: 0.5s; }
.stagger > *:nth-child(6) { animation-delay: 0.6s; }