/* ═══════════════════════════════════════════════════════════
   FEATURES — Theme, Search, FAQ, Quote, AI Demo, etc.
   ═══════════════════════════════════════════════════════════ */

/* Light theme */
[data-theme="light"] {
  --bg-deep: #f7f9fb;
  --bg-primary: #ffffff;
  --bg-surface: #f0f4f8;
  --bg-elevated: #e8edf2;
  --bg-card: rgba(255, 255, 255, 0.9);
  --text-primary: #0a1420;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: rgba(0, 0, 0, 0.08);
  --border-light: rgba(0, 0, 0, 0.12);
  --glass: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] body::before { opacity: 0.02; }
[data-theme="light"] .site-header.scrolled { background: var(--glass); }
[data-theme="light"] .text-gradient {
  background: linear-gradient(135deg, var(--navy) 0%, var(--teal) 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Header utilities */
.header-utils {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 1rem;
}

.util-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
}

.util-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-dim);
}

.nav-links-wrap { display: flex; align-items: center; gap: 2rem; }

@media (max-width: 768px) {
  .header-utils { margin-left: auto; margin-right: 0.5rem; }
  .nav-links-wrap { display: none; }
}

/* Search modal */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 10002;
  background: rgba(5, 10, 18, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.search-overlay.open { opacity: 1; visibility: visible; }

.search-modal {
  width: min(560px, 92vw);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transform: translateY(-20px);
  transition: transform 0.4s var(--ease-out-expo);
}

.search-overlay.open .search-modal { transform: translateY(0); }

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.search-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
}

.search-results { max-height: 320px; overflow-y: auto; }

.search-result {
  display: block;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.search-result:hover { background: var(--bg-elevated); }

.search-result strong { display: block; font-size: 0.92rem; margin-bottom: 0.15rem; }
.search-result span { font-size: 0.78rem; color: var(--text-muted); }

.search-empty { padding: 2rem; text-align: center; color: var(--text-muted); font-size: 0.9rem; }

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10001;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-light);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  transform: translateY(100%);
  transition: transform 0.5s var(--ease-out-expo);
}

.cookie-banner.show { transform: translateY(0); }

.cookie-banner p { font-size: 0.85rem; color: var(--text-secondary); max-width: 600px; }
.cookie-banner a { color: var(--teal); text-decoration: underline; }
.cookie-actions { display: flex; gap: 0.5rem; }

/* WhatsApp float */
.whatsapp-float {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 997;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.4);
  transition: transform 0.3s;
}

.whatsapp-float:hover { transform: scale(1.08); }

@media (max-width: 480px) {
  .whatsapp-float { bottom: 5.5rem; left: 1rem; width: 48px; height: 48px; }
}

/* Client logos */
.logos-section { padding: 4rem 0; border-block: 1px solid var(--border); }
.logos-label { text-align: center; font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 2rem; }
.logos-track { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 2.5rem 3.5rem; }
.logo-item { font-family: var(--font-display); font-size: 1.1rem; color: var(--text-muted); opacity: 0.5; transition: opacity 0.3s; white-space: nowrap; }
.logo-item:hover { opacity: 0.85; }

/* Awards */
.awards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem; }
.award-card { text-align: center; padding: 1.75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); transition: border-color 0.3s; }
.award-card:hover { border-color: var(--gold); }
.award-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.award-card h4 { font-family: var(--font-body); font-size: 0.88rem; font-weight: 600; margin-bottom: 0.25rem; }
.award-card p { font-size: 0.78rem; color: var(--text-muted); }

/* Before / After */
.ba-slider { position: relative; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 16/10; user-select: none; }
.ba-slider img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba-after { clip-path: inset(0 50% 0 0); }
.ba-handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; background: var(--gold); cursor: ew-resize; z-index: 2; transform: translateX(-50%); }
.ba-handle::after { content: '◀ ▶'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--gold); color: var(--bg-deep); font-size: 0.6rem; padding: 0.5rem 0.35rem; border-radius: 100px; white-space: nowrap; letter-spacing: 0.15em; }
.ba-labels { position: absolute; bottom: 1rem; left: 1rem; right: 1rem; display: flex; justify-content: space-between; z-index: 1; pointer-events: none; }
.ba-labels span { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; background: rgba(0,0,0,0.6); padding: 0.3rem 0.7rem; border-radius: 4px; }

/* Interactive stack */
.stack-visual { display: flex; flex-direction: column; gap: 0.6rem; max-width: 400px; margin: 0 auto; }
.stack-visual-layer { padding: 1rem 1.5rem; border-radius: var(--radius); border: 1px solid var(--border); cursor: pointer; transition: all 0.4s var(--ease-out-expo); display: flex; align-items: center; justify-content: space-between; }
.stack-visual-layer:hover, .stack-visual-layer.active { transform: translateX(12px); border-color: var(--teal); }
.stack-visual-layer:nth-child(1) { background: linear-gradient(90deg, rgba(45,90,158,0.3), transparent); margin-left: 0; }
.stack-visual-layer:nth-child(2) { background: linear-gradient(90deg, rgba(30,202,211,0.2), transparent); margin-left: 1rem; }
.stack-visual-layer:nth-child(3) { background: linear-gradient(90deg, rgba(232,148,58,0.2), transparent); margin-left: 2rem; }
.stack-visual-layer:nth-child(4) { background: linear-gradient(90deg, rgba(212,168,83,0.15), transparent); margin-left: 3rem; }
.stack-visual-layer span { font-size: 0.82rem; font-weight: 600; }
.stack-visual-detail { margin-top: 1.5rem; padding: 1.25rem; background: var(--bg-elevated); border-radius: var(--radius); border: 1px solid var(--border); font-size: 0.9rem; color: var(--text-secondary); min-height: 80px; }

/* AI Demo */
.ai-demo { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.ai-demo-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; font-weight: 600; }
.ai-demo-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); animation: status-blink 2s infinite; }
.ai-demo-body { padding: 1.25rem; min-height: 200px; max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 0.75rem; }
.ai-demo-input { display: flex; gap: 0.5rem; padding: 1rem; border-top: 1px solid var(--border); }
.ai-demo-input input { flex: 1; padding: 0.7rem 1rem; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 100px; color: var(--text-primary); font-family: inherit; font-size: 0.88rem; }
.ai-demo-input input:focus { outline: none; border-color: var(--teal); }

/* Newsletter */
.newsletter-form { display: flex; gap: 0.5rem; margin-top: 1rem; }
.newsletter-form input { flex: 1; padding: 0.7rem 1rem; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 100px; color: var(--text-primary); font-family: inherit; font-size: 0.85rem; }
.newsletter-form input:focus { outline: none; border-color: var(--teal); }
.newsletter-form button { padding: 0.7rem 1.25rem; background: var(--teal); color: var(--bg-deep); border: none; border-radius: 100px; font-weight: 600; font-size: 0.8rem; cursor: pointer; white-space: nowrap; }
.newsletter-success { font-size: 0.82rem; color: var(--teal); margin-top: 0.5rem; }

/* Lead magnet modal */
.modal-overlay { position: fixed; inset: 0; z-index: 10003; background: rgba(5,10,18,0.8); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 1rem; opacity: 0; visibility: hidden; transition: all 0.3s; }
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-card { background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 2.5rem; max-width: 440px; width: 100%; position: relative; transform: scale(0.95); transition: transform 0.4s var(--ease-out-expo); }
.modal-overlay.open .modal-card { transform: scale(1); }
.modal-close { position: absolute; top: 1rem; right: 1rem; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); color: var(--text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.modal-card h3 { margin-bottom: 0.75rem; }
.modal-card p { color: var(--text-secondary); font-size: 0.92rem; margin-bottom: 1.25rem; }

/* FAQ accordion */
.faq-list { display: flex; flex-direction: column; gap: 0.75rem; max-width: 800px; margin: 0 auto; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.faq-question { width: 100%; padding: 1.25rem 1.5rem; text-align: left; font-size: 0.95rem; font-weight: 600; color: var(--text-primary); display: flex; justify-content: space-between; align-items: center; gap: 1rem; cursor: pointer; background: var(--bg-surface); transition: background 0.3s; }
.faq-question:hover { background: var(--bg-elevated); }
.faq-question svg { flex-shrink: 0; transition: transform 0.3s; color: var(--gold); }
.faq-item.open .faq-question svg { transform: rotate(180deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.4s var(--ease-out-expo); }
.faq-item.open .faq-answer { max-height: 300px; }
.faq-answer-inner { padding: 0 1.5rem 1.25rem; color: var(--text-secondary); font-size: 0.92rem; line-height: 1.7; }

/* Quote wizard */
.quote-wizard { max-width: 700px; margin: 0 auto; }
.quote-steps { display: flex; gap: 0.5rem; margin-bottom: 2rem; }
.quote-step-dot { flex: 1; height: 3px; background: var(--border); border-radius: 2px; transition: background 0.3s; }
.quote-step-dot.active, .quote-step-dot.done { background: var(--teal); }
.quote-panel { display: none; animation: msg-in 0.4s ease; }
.quote-panel.active { display: block; }
.quote-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; margin: 1.5rem 0; }
.quote-option { padding: 1.25rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); text-align: center; cursor: pointer; transition: all 0.3s; font-size: 0.88rem; }
.quote-option:hover, .quote-option.selected { border-color: var(--teal); background: var(--teal-dim); color: var(--teal); }
.quote-result { text-align: center; padding: 2rem; background: var(--bg-elevated); border-radius: var(--radius-lg); border: 1px solid var(--border); margin-top: 1.5rem; }
.quote-result .price { font-family: var(--font-display); font-size: 2.5rem; color: var(--gold); margin: 0.5rem 0; }
.quote-nav { display: flex; justify-content: space-between; margin-top: 2rem; }

/* Tech matcher */
.matcher-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.matcher-options { display: flex; flex-direction: column; gap: 0.5rem; }
.matcher-opt { padding: 0.85rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-size: 0.88rem; transition: all 0.3s; }
.matcher-opt:hover, .matcher-opt.selected { border-color: var(--gold); background: var(--gold-dim); }
.matcher-result { padding: 1.5rem; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); min-height: 200px; }
.matcher-result h4 { color: var(--gold); margin-bottom: 0.75rem; font-family: var(--font-body); }
.tech-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }

/* Blog cards */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.blog-card { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: transform 0.4s, border-color 0.3s; }
.blog-card:hover { transform: translateY(-4px); border-color: var(--border-light); }
.blog-card-img { aspect-ratio: 16/9; overflow: hidden; }
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s; }
.blog-card:hover .blog-card-img img { transform: scale(1.05); }
.blog-card-body { padding: 1.5rem; }
.blog-card-date { font-size: 0.72rem; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.5rem; }
.blog-card h3 { font-size: 1.15rem; margin-bottom: 0.6rem; }
.blog-card p { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 1rem; }
.blog-card-link { font-size: 0.8rem; font-weight: 600; color: var(--gold); text-transform: uppercase; letter-spacing: 0.06em; }

/* Case study */
.case-meta { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 2rem 0; padding: 1.5rem; background: var(--bg-surface); border-radius: var(--radius); border: 1px solid var(--border); }
.case-meta dt { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.25rem; }
.case-meta dd { font-weight: 600; font-size: 0.95rem; }
.case-content { max-width: 720px; margin: 0 auto; }
.case-content h2 { margin: 2.5rem 0 1rem; }
.case-content p { color: var(--text-secondary); margin-bottom: 1.25rem; line-height: 1.75; }
.case-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 2rem 0; }
.case-stat { text-align: center; padding: 1.25rem; background: var(--bg-elevated); border-radius: var(--radius); border: 1px solid var(--border); }
.case-stat strong { display: block; font-family: var(--font-display); font-size: 1.75rem; color: var(--gold); }
.case-stat span { font-size: 0.78rem; color: var(--text-muted); }

/* Calendly embed */
.calendly-wrap { min-height: 650px; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-surface); }
.calendly-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 400px; padding: 3rem; text-align: center; }
.calendly-placeholder p { color: var(--text-muted); margin: 1rem 0 1.5rem; }

/* Status page */
.status-list { display: flex; flex-direction: column; gap: 0.75rem; max-width: 600px; margin: 0 auto; }
.status-item { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); }
.status-item .name { font-weight: 600; font-size: 0.92rem; }
.status-badge { font-size: 0.72rem; font-weight: 600; padding: 0.3rem 0.75rem; border-radius: 100px; text-transform: uppercase; letter-spacing: 0.06em; }
.status-badge--up { background: rgba(30,202,211,0.15); color: var(--teal); }
.status-badge--maint { background: rgba(232,148,58,0.15); color: var(--orange); }

/* Docs */
.docs-layout { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; }
.docs-nav { position: sticky; top: calc(var(--header-h) + 20px); }
.docs-nav a { display: block; padding: 0.5rem 0; font-size: 0.88rem; color: var(--text-muted); border-left: 2px solid transparent; padding-left: 0.75rem; transition: all 0.2s; }
.docs-nav a:hover, .docs-nav a.active { color: var(--teal); border-color: var(--teal); }
.docs-content pre { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; overflow-x: auto; font-size: 0.82rem; margin: 1rem 0; }
.docs-content code { color: var(--teal); }
.code-block { font-family: 'SF Mono', Monaco, monospace; }

/* Video testimonial */
.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.video-card { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); aspect-ratio: 16/9; background: var(--bg-elevated); }
.video-card iframe { width: 100%; height: 100%; border: none; }
.video-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; flex-direction: column; gap: 0.75rem; color: var(--text-muted); font-size: 0.88rem; }

/* 404 */
.error-page { min-height: 80vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2rem; }
.error-code { font-family: var(--font-display); font-size: clamp(6rem, 15vw, 10rem); color: var(--gold); opacity: 0.3; line-height: 1; }

/* Page transition */
body.page-exit { opacity: 0; transition: opacity 0.25s ease; }

/* File upload */
.file-upload { position: relative; }
.file-upload input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-upload-label { display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1.1rem; background: var(--bg-elevated); border: 1px dashed var(--border-light); border-radius: var(--radius-sm); font-size: 0.88rem; color: var(--text-muted); transition: border-color 0.3s; }
.file-upload:hover .file-upload-label { border-color: var(--teal); }

/* Footer extended */
.footer-newsletter h4 { margin-bottom: 0.5rem; }
.footer-legal { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-legal a { font-size: 0.82rem; color: var(--text-muted); }
.footer-legal a:hover { color: var(--teal); }

@media (max-width: 768px) {
  .matcher-grid, .docs-layout { grid-template-columns: 1fr; }
  .case-stats { grid-template-columns: 1fr; }
  .docs-nav { position: static; display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .docs-nav a { border-left: none; padding: 0.4rem 0.75rem; background: var(--bg-elevated); border-radius: 100px; }
}
