/* ============================================================
   KER Control de Contratos — Design System Premium
   Spec: Claude Code prompt V1 — Enterprise dark mode
   ============================================================ */

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

:root {
  --bg-base: #07090d;
  --bg-elevated: #0d1117;
  --bg-card: #11161d;
  --bg-hover: #161c25;
  --brand-primary: #0e7490;
  --brand-light: #22d3ee;
  --brand-glow: rgba(34, 211, 238, 0.15);
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --border-subtle: rgba(148, 163, 184, 0.08);
  --border-default: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.2);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.5);
  --glow-cyan: 0 0 40px rgba(14, 116, 144, 0.4);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.011em;
  background: var(--bg-base);
  color: var(--text-primary);
  overflow-x: hidden;
  font-size: 16px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* --- Skip Link --- */
.skip-link {
  position: absolute; top: -100%; left: 16px;
  padding: 8px 16px; background: var(--brand-primary);
  color: white; border-radius: var(--radius-sm);
  z-index: 9999; font-size: 14px;
}
.skip-link:focus { top: 8px; }

/* --- Container --- */
.container { max-width: 1280px; margin: 0 auto; padding: 0 48px; }
@media (max-width: 768px) { .container { padding: 0 24px; } }

/* --- Typography --- */
.text-hero { font-size: clamp(48px, 8vw, 88px); font-weight: 700; line-height: 1.05; letter-spacing: -0.04em; }
.text-h1 { font-size: clamp(36px, 5vw, 56px); font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; }
.text-h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 600; line-height: 1.15; letter-spacing: -0.025em; }
.text-h3 { font-size: clamp(20px, 2.5vw, 28px); font-weight: 600; line-height: 1.25; letter-spacing: -0.015em; }
.text-lead { font-size: clamp(18px, 1.6vw, 22px); font-weight: 400; line-height: 1.5; color: var(--text-secondary); }
.text-body { font-size: 16px; font-weight: 400; line-height: 1.6; }
.text-small { font-size: 14px; font-weight: 400; line-height: 1.5; color: var(--text-tertiary); }
.text-eyebrow { font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-light); }
.gradient-text { background: linear-gradient(135deg, #22d3ee 0%, #0e7490 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; border-radius: var(--radius-md);
  font-weight: 600; font-size: 14px;
  padding: 10px 18px;
  transition: all var(--duration-base) var(--ease-out);
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--brand-light); outline-offset: 2px; }
.btn-primary {
  background: var(--brand-primary); color: white;
}
.btn-primary:hover { background: #0891b2; transform: translateY(-2px); box-shadow: var(--glow-cyan); }
.btn-secondary {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { border-color: var(--brand-light); color: var(--text-primary); background: rgba(255,255,255,0.03); }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius-md); }

/* --- Navbar --- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 64px; display: flex; align-items: center;
  transition: all var(--duration-base) var(--ease-out);
}
.navbar.scrolled {
  background: rgba(7, 9, 13, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.navbar-brand { display: flex; align-items: center; gap: 4px; font-weight: 700; font-size: 16px; }
.navbar-badge { background: var(--brand-primary); padding: 2px 8px; border-radius: 4px; font-weight: 500; font-size: 13px; }
.navbar-links { display: flex; gap: 32px; }
.navbar-links a { font-size: 14px; font-weight: 500; color: var(--text-secondary); transition: color var(--duration-fast); }
.navbar-links a:hover { color: var(--text-primary); }
.navbar-actions { display: flex; gap: 12px; align-items: center; }
.hamburger { display: none; background: none; border: none; color: var(--text-secondary); padding: 8px; }

@media (max-width: 768px) {
  .navbar-links { display: none; }
  .hamburger { display: block; }
}

/* --- Hero --- */
.hero {
  position: relative; min-height: 100vh;
  padding-top: 120px; padding-bottom: 80px;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(circle 600px at 15% 25%, rgba(14, 116, 144, 0.15), transparent),
    radial-gradient(circle 500px at 85% 20%, rgba(34, 211, 238, 0.08), transparent),
    radial-gradient(circle 800px at 50% 80%, rgba(14, 116, 144, 0.05), transparent);
}
#three-canvas {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 1; pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}
.hero-content { position: relative; z-index: 2; }

.eyebrow-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--brand-primary);
  background: rgba(14, 116, 144, 0.1);
  font-size: 13px; color: var(--brand-light);
}
.eyebrow-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand-light);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.hero h1 { margin-top: 32px; max-width: 800px; }
.hero .text-lead { margin-top: 24px; max-width: 640px; }
.hero-ctas { display: flex; gap: 12px; margin-top: 40px; flex-wrap: wrap; }

.trust-strip { margin-top: 64px; display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.trust-strip .text-eyebrow { font-size: 11px; }
.trust-logos { display: flex; gap: 32px; opacity: 0.35; align-items: center; }
.trust-logos span { font-size: 14px; font-weight: 600; color: var(--text-tertiary); letter-spacing: 0.04em; }

/* --- Stats Bar --- */
.stats-bar { background: var(--bg-elevated); padding: 48px 0; border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; text-align: center; }
.stat-number { font-size: clamp(36px, 5vw, 56px); font-weight: 700; color: var(--brand-light); line-height: 1.1; }
.stat-label { font-size: 14px; color: var(--text-tertiary); margin-top: 8px; }

@media (max-width: 768px) { .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; } }

/* --- Section Base --- */
.section { padding: 128px 0; }
.section-elevated { background: var(--bg-elevated); }
.section-header { text-align: center; margin-bottom: 64px; }
.section-header .text-eyebrow { margin-bottom: 16px; display: block; }
.section-header .text-lead { margin-top: 16px; max-width: 640px; margin-left: auto; margin-right: auto; }

@media (max-width: 768px) { .section { padding: 80px 0; } }

/* --- Cards --- */
.card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 32px;
  transition: all var(--duration-base) var(--ease-out);
}
.card:hover { border-color: var(--border-default); transform: translateY(-4px); background: var(--bg-hover); }
.card-icon {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  background: rgba(14, 116, 144, 0.1); border: 1px solid rgba(14, 116, 144, 0.2);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-light); margin-bottom: 20px; font-size: 20px;
}
.card h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.card p { font-size: 15px; color: var(--text-secondary); line-height: 1.6; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }

@media (max-width: 1024px) { .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; } }

/* --- Solution Split --- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
@media (max-width: 1024px) { .split { grid-template-columns: 1fr; gap: 48px; } }

.check-list { list-style: none; display: flex; flex-direction: column; gap: 16px; margin-top: 32px; }
.check-list li {
  display: flex; align-items: flex-start; gap: 12px;
  font-size: 16px; color: var(--text-secondary); line-height: 1.5;
}
.check-icon { color: var(--brand-light); font-size: 18px; flex-shrink: 0; margin-top: 2px; }

/* --- Dashboard Mockup --- */
.mockup {
  background: var(--bg-card); border: 1px solid var(--border-default);
  border-radius: var(--radius-xl); padding: 24px;
  animation: mock-float 6s ease-in-out infinite;
  box-shadow: var(--shadow-lg);
}
@keyframes mock-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.mockup-header { display: flex; gap: 6px; margin-bottom: 20px; }
.mockup-dot { width: 10px; height: 10px; border-radius: 50%; }
.mockup-dot:nth-child(1) { background: var(--accent-rose); }
.mockup-dot:nth-child(2) { background: var(--accent-amber); }
.mockup-dot:nth-child(3) { background: var(--accent-emerald); }
.mockup-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mockup-kpi {
  background: var(--bg-base); border-radius: var(--radius-md);
  padding: 16px; text-align: center;
}
.mockup-kpi-value { font-size: 24px; font-weight: 700; }
.mockup-kpi-label { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.06em; }
.green { color: var(--accent-emerald); }
.amber { color: var(--accent-amber); }
.rose { color: var(--accent-rose); }

/* --- KPI Cards --- */
.kpi-mini {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 20px;
  transition: all var(--duration-base) var(--ease-out);
}
.kpi-mini:hover { border-color: rgba(14, 116, 144, 0.3); background: var(--bg-hover); box-shadow: 0 0 20px rgba(14, 116, 144, 0.08); }
.kpi-mini-id { font-family: 'JetBrains Mono', 'SF Mono', monospace; font-size: 12px; color: var(--brand-light); font-weight: 600; }
.kpi-mini-name { font-size: 14px; font-weight: 500; margin-top: 8px; }
.kpi-mini-bar { height: 3px; background: var(--border-subtle); border-radius: 2px; margin-top: 12px; overflow: hidden; }
.kpi-mini-bar-fill { height: 100%; border-radius: 2px; background: var(--brand-primary); }

/* --- Steps Timeline --- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; position: relative; }
.steps::before {
  content: ''; position: absolute;
  top: 48px; left: 16.6%; right: 16.6%; height: 2px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-light), var(--brand-primary));
  opacity: 0.3;
}
@media (max-width: 768px) {
  .steps { grid-template-columns: 1fr; }
  .steps::before { display: none; }
}
.step { text-align: center; position: relative; }
.step-number {
  font-size: clamp(48px, 8vw, 80px); font-weight: 800; line-height: 1;
  -webkit-text-stroke: 1px var(--brand-light);
  color: transparent; margin-bottom: 20px;
}
.step h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.step p { font-size: 15px; color: var(--text-secondary); line-height: 1.6; max-width: 300px; margin: 0 auto; }

/* --- Segments --- */
.segment {
  text-align: center; padding: 24px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  transition: all var(--duration-base) var(--ease-out);
}
.segment:hover { border-color: var(--border-default); background: var(--bg-card); transform: translateY(-4px); }
.segment-icon { font-size: 28px; margin-bottom: 12px; }
.segment h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.segment p { font-size: 13px; color: var(--text-tertiary); line-height: 1.4; }

/* --- CTA Block --- */
.cta-block {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 80px 48px; text-align: center;
  position: relative; overflow: hidden;
}
.cta-block::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle 400px at 30% 50%, rgba(14, 116, 144, 0.12), transparent),
    radial-gradient(circle 300px at 70% 50%, rgba(34, 211, 238, 0.06), transparent);
  pointer-events: none;
}
.cta-block > * { position: relative; z-index: 1; }
.cta-block h2 { margin-bottom: 16px; }
.cta-block .text-lead { max-width: 500px; margin: 0 auto 32px; }
.cta-block .btn { margin: 0 6px; }
.trust-line { margin-top: 32px; font-size: 13px; color: var(--text-tertiary); display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; }

/* --- Footer --- */
.footer { padding: 80px 0 32px; border-top: 1px solid var(--border-subtle); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; }
.footer-brand p { font-size: 14px; color: var(--text-tertiary); margin-top: 12px; line-height: 1.6; }
.footer-col h4 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); margin-bottom: 16px; }
.footer-col a { display: block; font-size: 14px; color: var(--text-tertiary); padding: 4px 0; transition: color var(--duration-fast); }
.footer-col a:hover { color: var(--text-primary); }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border-subtle); display: flex; justify-content: space-between; align-items: center; }
.footer-bottom p { font-size: 13px; color: var(--text-tertiary); }
.footer-social { display: flex; gap: 16px; }
.footer-social a { color: var(--text-tertiary); transition: color var(--duration-fast); }
.footer-social a:hover { color: var(--text-primary); }

@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* --- Auth Modal --- */
.auth-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
.auth-card {
  background: var(--bg-elevated); border: 1px solid var(--border-default);
  border-radius: var(--radius-xl); padding: 48px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.3s var(--ease-out);
}
@keyframes modal-in { from { opacity: 0; transform: scale(0.96) translateY(8px); } }
.auth-card h2 { text-align: center; font-size: 24px; margin-bottom: 8px; }
.auth-subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 28px; font-size: 15px; }
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-tertiary); margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 11px 14px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border-default);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 15px; font-family: inherit;
  transition: all var(--duration-base);
}
.form-input:focus { outline: none; border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(14,116,144,0.2); }
.form-input::placeholder { color: var(--text-tertiary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-error { color: var(--accent-rose); font-size: 13px; min-height: 18px; margin-bottom: 8px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-tertiary); }
.auth-footer a { color: var(--brand-light); font-weight: 500; }

/* --- Scroll Reveal --- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.stagger-1 { transition-delay: 50ms; }
.stagger-2 { transition-delay: 100ms; }
.stagger-3 { transition-delay: 150ms; }
.stagger-4 { transition-delay: 200ms; }
.stagger-5 { transition-delay: 250ms; }

.hidden { display: none !important; }

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
  #three-canvas { display: none; }
}
