:root {
  --bg: #0a0e14;
  --bg-card: #12161f;
  --bg-card-hover: #161b26;
  --border: #202634;
  --text: #e8eaed;
  --text-muted: #8b93a1;
  --accent-blue: #00c2cb;
  --accent-blue-hover: #40d1d8;
  --accent-green: #4c80b8;
  --accent-green-soft: rgba(0, 74, 153, 0.18);
  --danger: #e5534b;
  --radius: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: var(--accent-blue); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-blue);
}

.brand-icon {
  height: 28px;
  width: auto;
}

.nav-cta {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.15s ease;
}

.nav-cta:hover { border-color: var(--accent-blue); }

/* Hero */
.hero {
  padding: 96px 0 72px;
  text-align: center;
}

.badge {
  display: inline-block;
  background: var(--accent-green-soft);
  color: var(--accent-green);
  border: 1px solid rgba(0, 74, 153, 0.4);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 24px;
}

.hero-icon {
  height: 96px;
  width: auto;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(2.5rem, 7vw, 4rem);
  margin: 0;
  letter-spacing: 0.04em;
  color: var(--accent-blue);
}

.hero-sub {
  font-size: 1.25rem;
  color: var(--text);
  margin: 12px 0 0;
}

.hero-desc {
  max-width: 560px;
  margin: 20px auto 32px;
  color: var(--text-muted);
}

.btn {
  display: inline-block;
  border-radius: var(--radius);
  padding: 12px 28px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background: var(--accent-blue);
  color: #0a0e14;
  transition: background 0.15s ease;
}

.btn-primary:hover { background: var(--accent-blue-hover); }

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Trust bar */
.trust-bar {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.trust-bar-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 32px;
  padding: 16px 24px;
}

.trust-item {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Services */
.services { padding: 48px 0 72px; border-top: 1px solid var(--border); }

.services h2, .quoter h2 {
  text-align: center;
  margin-bottom: 40px;
  font-size: 1.75rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-blue);
  border-radius: var(--radius);
  padding: 24px;
}

.service-icon { font-size: 1.5rem; }

.service-card h3 {
  margin: 12px 0 8px;
  font-size: 1.05rem;
}

.service-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0;
}

/* Demos */
.demos { padding: 48px 0 72px; border-top: 1px solid var(--border); }

.demos-sub {
  text-align: center;
  color: var(--text-muted);
  margin-top: -24px;
  margin-bottom: 40px;
}

.demo-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}

.demo-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.demo-panel-header h3 { margin: 0; font-size: 1.1rem; }
.demo-icon { font-size: 1.3rem; }

.demo-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 8px 0 20px;
}

.demo-result {
  min-height: 1.4em;
  color: var(--accent-green);
  font-size: 0.9rem;
  font-weight: 600;
  margin: 12px 0 0;
}

/* Demo: automatización */
.demo-steps {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.demo-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text);
  transition: opacity 0.3s ease, color 0.3s ease;
}

.demo-step-check { color: var(--text-muted); }

.demo-steps li.done {
  color: var(--text-muted);
  text-decoration: line-through;
  opacity: 0.65;
}

.demo-steps li.done .demo-step-check { color: var(--accent-green); }

/* Demo: bases de datos */
.db-diagram {
  width: 100%;
  height: auto;
  max-width: 500px;
  display: block;
  margin: 0 auto 12px;
}

.db-box rect {
  fill: var(--bg);
  stroke: var(--border);
  stroke-width: 1.5;
  transition: stroke 0.2s ease;
}

.db-box { cursor: pointer; }
.db-box:focus { outline: none; }
.db-box:focus rect, .db-box.selected rect { stroke: var(--accent-blue); stroke-width: 2; }

.db-box-title {
  fill: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.db-box-cols {
  fill: var(--text-muted);
  font-size: 11px;
}

.db-connection {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.db-connection.visible { opacity: 1; }

.db-connection line {
  stroke: var(--accent-blue);
  stroke-width: 2;
}

.db-connection text {
  fill: var(--accent-blue);
  font-size: 12px;
  font-weight: 700;
}

/* Demo: integración */
.integration-flow { margin-bottom: 20px; }

.flow-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.flow-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 96px;
  transition: border-color 0.3s ease;
}

.flow-node .flow-icon { font-size: 1.4rem; }
.flow-node .flow-label { font-size: 0.75rem; color: var(--text-muted); }

.flow-node.received { border-color: var(--accent-green); }

.flow-connector {
  position: relative;
  width: 60px;
  height: 2px;
  background: var(--border);
}

.flow-connector .flow-dot {
  position: absolute;
  top: 50%;
  left: 0;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--accent-blue);
  opacity: 0;
}

.flow-connector.active .flow-dot {
  animation: flow-travel-x 0.5s ease forwards;
}

@keyframes flow-travel-x {
  0% { left: 0; opacity: 1; }
  90% { opacity: 1; }
  100% { left: calc(100% - 8px); opacity: 0; }
}

.flow-destinations {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.flow-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.flow-connector-vertical {
  width: 2px;
  height: 32px;
}

.flow-connector-vertical .flow-dot {
  top: 0;
  left: 50%;
  margin-top: 0;
  margin-left: -4px;
}

.flow-connector-vertical.active .flow-dot {
  animation: flow-travel-y 0.5s ease forwards;
}

@keyframes flow-travel-y {
  0% { top: 0; opacity: 1; }
  90% { opacity: 1; }
  100% { top: calc(100% - 8px); opacity: 0; }
}

.demo-payload {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 0.82rem;
  color: var(--accent-green);
  overflow-x: auto;
  margin: 0;
}

/* Portfolio */
.portfolio { padding: 48px 0 72px; border-top: 1px solid var(--border); }

.portfolio-sub {
  text-align: center;
  color: var(--text-muted);
  margin-top: -24px;
  margin-bottom: 40px;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.portfolio-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-green);
  border-radius: var(--radius);
  padding: 24px;
}

.portfolio-media {
  display: none; /* reservado para cuando se agregue una captura/GIF real */
}

.portfolio-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-green);
}

.portfolio-card h3 {
  margin: 10px 0 8px;
  font-size: 1.05rem;
}

.portfolio-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.portfolio-card h3 a:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

.portfolio-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0;
}

/* Diagnostic */
.diagnostic { padding: 48px 0 72px; border-top: 1px solid var(--border); }

.diagnostic-sub {
  text-align: center;
  color: var(--text-muted);
  margin-top: -24px;
  margin-bottom: 40px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.diagnostic-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 560px;
  margin: 0 auto;
}

.diagnostic-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.diagnostic-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s ease;
}

.diagnostic-dot.active { background: var(--accent-blue); }
.diagnostic-dot.done { background: var(--accent-green); }

.diagnostic-question-text {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 20px;
}

.diagnostic-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.diagnostic-option {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text);
  font-size: 0.92rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.diagnostic-option:hover { border-color: var(--accent-blue); }

.diagnostic-result {
  text-align: center;
}

.diagnostic-result-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0 0 8px;
}

.diagnostic-result-services {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-blue);
  margin: 0 0 20px;
}

.diagnostic-restart {
  display: block;
  margin: 14px auto 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.diagnostic-restart:hover { color: var(--text); }

/* Quoter */
.quoter { padding: 48px 0 96px; border-top: 1px solid var(--border); }

.quoter-sub {
  text-align: center;
  color: var(--text-muted);
  margin-top: -24px;
  margin-bottom: 40px;
}

.quote-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.field { margin-bottom: 20px; }

.field label, .services-field legend {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

input, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.services-field { border: none; padding: 0; margin: 4px 0 20px; }

.checkbox-list { display: flex; flex-direction: column; gap: 10px; }

.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.checkbox-item:hover { border-color: var(--accent-blue); }

.checkbox-item input { width: auto; margin-top: 3px; accent-color: var(--accent-blue); }

.checkbox-item-text { flex: 1; }

.checkbox-item-title {
  font-weight: 600;
  font-size: 0.92rem;
}

.checkbox-item-desc {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 2px;
}

.checkbox-item-tier {
  color: var(--accent-blue);
  font-size: 0.9rem;
  opacity: 0.75;
  white-space: nowrap;
}

.estimate-box {
  background: var(--bg);
  border: 1px dashed var(--accent-blue);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
}

.estimate-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.estimate-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-blue);
  margin: 6px 0;
}

.estimate-note {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.form-status {
  min-height: 1.2em;
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.form-status.success { color: var(--accent-green); }
.form-status.error { color: var(--danger); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-icon {
  height: 16px;
  width: auto;
  vertical-align: middle;
  margin-right: 4px;
}
