/* =============================================
   Legatus Ecom — Deep Tech & Trust
   ============================================= */

:root {
  --midnight: #0F172A;
  --midnight-light: #1E293B;
  --midnight-lighter: #334155;
  --smoke: #F8FAFC;
  --smoke-muted: #CBD5E1;
  --electric: #3B82F6;
  --electric-dark: #2563EB;
  --gold: #D4AF37;
  --gold-muted: rgba(212, 175, 55, 0.15);
  --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background-color: var(--electric);
  color: var(--smoke);
}

/* --- Navigation --- */
#navbar.scrolled {
  background-color: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-link {
  transition: color var(--transition);
}

.nav-link:hover {
  color: var(--smoke);
}

.mobile-menu {
  max-height: 0;
  overflow: hidden;
  background-color: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(12px);
  transition: max-height 0.35s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mobile-menu.open {
  max-height: 380px;
}

.mobile-nav-link {
  color: var(--smoke-muted);
  transition: color var(--transition);
}

.mobile-nav-link:hover {
  color: var(--smoke);
}

#menu-toggle.active .menu-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

#menu-toggle.active .menu-bar:nth-child(2) {
  opacity: 0;
}

#menu-toggle.active .menu-bar:nth-child(3) {
  width: 1.5rem;
  transform: translateY(-8px) rotate(-45deg);
}

/* --- Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--electric);
  color: var(--smoke);
  border-radius: 6px;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.btn-primary:hover {
  background-color: var(--electric-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* --- Badge --- */
.badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(212, 175, 55, 0.35);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background-color: var(--gold-muted);
}

/* --- Hero --- */
.hero-glow {
  background:
    radial-gradient(ellipse 70% 50% at 20% 20%, rgba(59, 130, 246, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 60%, rgba(212, 175, 55, 0.06) 0%, transparent 50%);
}

.hero-grid {
  background-image:
    linear-gradient(rgba(248, 250, 252, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(248, 250, 252, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.4;
}

/* --- Sections --- */
.section-padding {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

@media (min-width: 768px) {
  .section-padding {
    padding-top: 7rem;
    padding-bottom: 7rem;
  }
}

/* --- Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* --- Pain cards --- */
.pain-card {
  padding: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color var(--transition), background-color var(--transition);
}

.pain-card:hover {
  border-color: rgba(59, 130, 246, 0.25);
  background: rgba(59, 130, 246, 0.04);
}

.pain-index {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

/* --- Phase cards --- */
.phase-card {
  padding: 1.5rem 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  transition: all var(--transition);
}

.phase-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

.phase-card--highlight {
  border-color: rgba(212, 175, 55, 0.3);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.phase-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.phase-number {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--electric);
}

.phase-tag {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

/* --- Authority --- */
.authority-quote {
  border-left: 2px solid var(--gold);
  padding-left: 1.5rem;
}

.stat-pill {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.875rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.stat-pill-value {
  font-size: 1.125rem;
  font-weight: 700;
}

.stat-pill-label {
  font-size: 0.6875rem;
  color: var(--smoke-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* --- CTA band --- */
.cta-band {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.08) 0%, rgba(212, 175, 55, 0.06) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* --- Case cards --- */
.case-card {
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  transition: all var(--transition);
}

.case-card:hover {
  border-color: rgba(212, 175, 55, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.case-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 8px;
  background: var(--gold-muted);
  margin-bottom: 1.25rem;
}

/* --- FAQ --- */
.faq-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.faq-item[open] {
  border-color: rgba(59, 130, 246, 0.25);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  transition: color var(--transition);
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--gold);
  flex-shrink: 0;
  transition: transform var(--transition);
}

.faq-item[open] .faq-question::after {
  transform: rotate(45deg);
}

.faq-question:hover {
  color: var(--electric);
}

.faq-answer {
  padding: 0 1.5rem 1.25rem;
  color: var(--smoke-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
  font-weight: 300;
}

.faq-item--wide .faq-answer {
  padding-bottom: 1.5rem;
}

/* --- Comparison table (Leadfluence-style) --- */
.compare-table-wrapper {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.6);
}

.compare-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.compare-table th,
.compare-table td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}

.compare-table thead th {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--smoke-muted);
  background: rgba(255, 255, 255, 0.03);
}

.compare-table tbody tr:last-child td {
  border-bottom: none;
}

.compare-table td:first-child {
  font-weight: 500;
  color: var(--smoke);
  width: 28%;
}

.compare-table td:nth-child(3) {
  color: var(--smoke-muted);
  font-weight: 300;
}

.compare-highlight {
  color: var(--smoke) !important;
  font-weight: 500 !important;
  background: rgba(59, 130, 246, 0.06);
}

.compare-table thead .compare-highlight {
  color: var(--electric) !important;
}

/* --- Contact --- */
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--smoke-muted);
  transition: color var(--transition);
}

.contact-link.justify-center {
  justify-content: center;
}

.contact-link:hover {
  color: var(--electric);
}

.contact-link-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition: border-color var(--transition);
}

.contact-link:hover .contact-link-icon {
  border-color: rgba(59, 130, 246, 0.4);
}

.contact-form {
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.form-group {
  margin-bottom: 1.125rem;
}

.form-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--smoke-muted);
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--smoke);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), background-color var(--transition);
}

.form-input::placeholder {
  color: rgba(203, 213, 225, 0.45);
}

.form-input:focus {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(255, 255, 255, 0.06);
}

.form-input.error {
  border-color: #ef4444;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%23CBD5E1' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.form-textarea {
  resize: vertical;
  min-height: 96px;
}

.form-error {
  display: block;
  font-size: 0.75rem;
  color: #ef4444;
  margin-top: 0.3rem;
  min-height: 1rem;
}

.form-success {
  margin-top: 1rem;
  padding: 0.875rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--electric);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.08);
}

.hidden {
  display: none;
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn-primary:hover,
  .case-card:hover {
    transform: none;
  }
}
