/* ==========================================================================
   SHARED COMPONENTS — AIdetreabă
   Navigation, footer, buttons, cards, FAQ accordion, section utilities.
   All brand colors reference variables.css tokens exclusively.
   ========================================================================== */

/* ---- BASE ---- */
html, body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
}

/* ---- LAYOUT ---- */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}
@media (min-width: 1280px) { .container { max-width: 1240px; } }
@media (max-width: 480px)  { .container { padding: 0 var(--space-md); } }

.section {
  padding: var(--space-4xl) 0;
}
.section--sm {
  padding: var(--space-3xl) 0;
}
.section--dark {
  background: var(--color-bg-surface);
}
.section--darker {
  background: #030410;
}
.section--border-top {
  border-top: 1px solid var(--color-border);
}
.section--border-bottom {
  border-bottom: 1px solid var(--color-border);
}

/* Section heading helpers */
.section-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}
.section-heading {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--color-text);
  margin-bottom: var(--space-md);
}
.section-sub {
  font-size: clamp(1rem, 1.8vw, 1.1rem);
  color: var(--color-text-muted);
  line-height: 1.65;
  max-width: 600px;
  margin-bottom: var(--space-2xl);
}
.section-header-centered {
  text-align: center;
}
.section-header-centered .section-sub {
  margin-left: auto;
  margin-right: auto;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.875rem 1.5rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform var(--ts-fast) var(--ease-out),
    box-shadow var(--ts-med) var(--ease-out),
    filter var(--ts-fast) var(--ease-out),
    border-color var(--ts-fast),
    color var(--ts-fast),
    background var(--ts-fast);
}
.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--gradient-brand);
  color: #05060f;
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover  { transform: translateY(-2px) scale(1.02); filter: saturate(1.1); }
.btn-primary:active { transform: translateY(0) scale(.98); }

.btn-secondary {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text-muted);
}
.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  padding-left: 0;
  padding-right: 0;
}
.btn-ghost:hover { color: var(--color-text); }

/* Size modifier */
.btn-lg {
  padding: 1.1rem 2rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}
.btn-sm {
  padding: 0.625rem 1.1rem;
  font-size: 0.875rem;
}

/* Arrow icon inside button */
.btn svg { flex-shrink: 0; }

/* ---- BADGE / PILL ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
}
.badge--brand {
  border-color: rgba(86,97,255,.35);
  color: var(--color-primary);
  background: rgba(86,97,255,.08);
}
.badge--success {
  border-color: rgba(32,227,178,.3);
  color: var(--color-success);
  background: rgba(32,227,178,.06);
}

/* ---- CARD ---- */
.card {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition:
    border-color var(--ts-med) var(--ease-out),
    transform var(--ts-med) var(--ease-out),
    box-shadow var(--ts-med) var(--ease-out);
}
.card:hover {
  border-color: rgba(86,97,255,.4);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(86,97,255,.12);
  display: grid;
  place-items: center;
  color: var(--color-primary);
  margin-bottom: var(--space-md);
  flex-shrink: 0;
}
.card-icon svg { width: 22px; height: 22px; }

.card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}
.card-text {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* ---- GRADIENT TEXT ---- */
.text-gradient {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- TRUST INDICATORS ---- */
.trust-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md) var(--space-xl);
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--color-text-subtle);
}
.trust-item svg {
  color: var(--color-success);
  flex-shrink: 0;
}

/* ---- NAVIGATION ---- */
#site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(5,7,19,.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition:
    background var(--ts-med) var(--ease-out),
    border-color var(--ts-med) var(--ease-out),
    box-shadow var(--ts-med) var(--ease-out);
}
#site-header.scrolled {
  background: rgba(5,7,19,.92);
  border-color: var(--color-border);
  box-shadow: 0 1px 0 var(--color-border), var(--shadow-sm);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  padding: 13px 0;
}

.nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.nav-logo img {
  width: 185px;
  height: auto;
  display: block;
}
@media (max-width: 900px) {
  .nav-logo img { width: 150px; }
}

.nav-links {
  display: none;
  align-items: center;
  gap: var(--space-xl);
  margin-left: auto;
}
@media (min-width: 900px) {
  .nav-links { display: flex; }
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--ts-fast);
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  border-radius: var(--radius-full);
  background: var(--gradient-brand);
  transition: width var(--ts-med) var(--ease-out);
}
.nav-link:hover        { color: var(--color-text); }
.nav-link:hover::after { width: 100%; }
.nav-link.active       { color: var(--color-text); }
.nav-link.active::after { width: 100%; }
.nav-link--accent { color: var(--color-primary) !important; font-weight: 700; }

.nav-cta {
  margin-left: auto;
  flex-shrink: 0;
}
.nav-cta--stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.08rem;
  line-height: 1.05;
  padding-top: 0.78rem;
  padding-bottom: 0.78rem;
}
.nav-cta-main {
  font-size: 0.95rem;
  font-weight: 800;
}
.nav-cta-sub {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.72;
}
@media (max-width: 899px) {
  .nav-cta--stack .nav-cta-sub { display: none; }
}
/* On mobile, hide nav-links AND nav-cta; show hamburger */
@media (max-width: 899px) {
  .nav-links { display: none; }
  .nav-cta   { display: none; }
}
@media (min-width: 900px) {
  .hamburger { display: none !important; }
}

/* The Demo entry adds one more primary destination. Keep the header airy on
   compact laptops and tablets by switching to the drawer a little earlier. */
@media (min-width: 900px) and (max-width: 1039px) {
  .nav-links,
  .nav-cta { display: none; }
  .hamburger { display: flex !important; }
}

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 4px;
  margin-left: auto;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  opacity: 0.9;
  border-radius: 2px;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.drawer-open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.drawer-open .hamburger span:nth-child(2) { opacity: 0; }
.drawer-open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5,7,19,.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 98;
}
.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(92vw, 380px);
  background: #fff;
  color: #0b0c10;
  border-left: 1px solid #e5e7ef;
  box-shadow: var(--shadow-lg);
  transform: translateX(102%);
  transition: transform 0.28s var(--ease-out);
  display: flex;
  flex-direction: column;
  z-index: 99;
  overflow: hidden;
}
.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
.drawer-open .drawer-panel    { transform: translateX(0); }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eef1f6;
  flex-shrink: 0;
}
.drawer-head-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
}
.drawer-close {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 4px;
}
.drawer-close span {
  display: block;
  width: 22px;
  height: 2px;
  background: #0b0c10;
  border-radius: 2px;
}
.drawer-close span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.drawer-close span:nth-child(2) { opacity: 0; }
.drawer-close span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.drawer-body {
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 4px;
  overflow-y: auto;
  flex: 1;
}
.drawer-link {
  display: block;
  padding: 14px 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0b0c10 !important;
  text-decoration: none;
  border-bottom: 1px solid #f0f3f9;
  transition: color 0.18s ease, padding-left 0.18s ease;
}
.drawer-link:hover        { color: var(--color-primary) !important; padding-left: 6px; }
.drawer-link--cta {
  margin-top: var(--space-md);
  background: var(--gradient-brand);
  color: #05060f !important;
  border: none;
  border-radius: var(--radius-md);
  text-align: center;
  padding: 16px 20px;
  display: block;
  font-size: 1rem;
}
.drawer-link--cta:hover { padding-left: 0 !important; filter: saturate(1.1); }

.drawer-foot {
  padding: 16px 20px;
  border-top: 1px solid #eef1f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.drawer-foot img   { height: 26px; width: auto; }
.drawer-socials    { display: flex; gap: 14px; }
.drawer-socials a  { color: #64748b; font-size: 0.82rem; font-weight: 600; text-decoration: none; }
.drawer-socials a:hover { color: var(--color-primary); }

/* ---- FOOTER ---- */
.site-footer {
  position: relative;
  color: #e7ecff;
  background-image:
    linear-gradient(180deg, rgba(5,7,19,.8), rgba(7,10,28,.92)),
    url('/img/footer.webp');
  background-size: cover;
  background-position: 60% 30%;
  padding: var(--space-3xl) 0 var(--space-2xl);
  border-top: 1px solid rgba(255,255,255,.07);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: var(--space-3xl);
  margin-bottom: var(--space-3xl);
}
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
  }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-logo {
  height: 30px;
  width: auto;
  margin-bottom: var(--space-md);
}
.footer-tagline {
  color: #98a9c8;
  font-size: 0.875rem;
  line-height: 1.65;
  max-width: 260px;
  margin: 0 0 var(--space-md);
}
.footer-email-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: #c4cfe8;
  text-decoration: none;
  transition: color var(--ts-fast);
}
.footer-email-link:hover { color: var(--color-text); }

.footer-col-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-md);
  display: block;
}
.footer-col-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.footer-col-links a {
  color: #98a9c8;
  font-size: 0.875rem;
  text-decoration: none;
  transition: color var(--ts-fast);
  line-height: 1.4;
}
.footer-col-links a:hover { color: var(--color-text); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
  padding-top: var(--space-xl);
  border-top: 1px solid rgba(255,255,255,.08);
}
.footer-copy { font-size: 0.82rem; color: #5a6585; }
.footer-socials {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.footer-socials a {
  font-size: 0.82rem;
  font-weight: 600;
  color: #5a6585;
  text-decoration: none;
  transition: color var(--ts-fast);
  letter-spacing: 0.04em;
}
.footer-socials a:hover { color: var(--color-text); }

/* ---- FAQ ACCORDION ---- */
.faq-list {
  display: flex;
  flex-direction: column;
}
.faq-item {
  border-bottom: 1px solid var(--color-border);
}
.faq-item:first-child { border-top: 1px solid var(--color-border); }

.faq-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-lg) 0;
  background: none;
  border: none;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: color var(--ts-fast);
}
.faq-btn:hover { color: var(--color-primary); }
.faq-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.faq-icon {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--color-text-subtle);
  transition:
    transform var(--ts-med) var(--ease-out),
    border-color var(--ts-fast),
    background var(--ts-fast),
    color var(--ts-fast);
}
.faq-item.open .faq-icon {
  transform: rotate(45deg);
  border-color: var(--color-primary);
  background: rgba(86,97,255,.1);
  color: var(--color-primary);
}

.faq-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--ts-slow) var(--ease-out);
}
.faq-item.open .faq-body { max-height: 500px; }

.faq-answer {
  padding-bottom: var(--space-xl);
  color: var(--color-text-muted);
  line-height: 1.7;
  font-size: 0.95rem;
}

/* ---- SCROLL ANIMATIONS ---- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.55s var(--ease-out),
    transform 0.55s var(--ease-out);
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
.fade-in--d1 { transition-delay: 0.08s; }
.fade-in--d2 { transition-delay: 0.16s; }
.fade-in--d3 { transition-delay: 0.24s; }
.fade-in--d4 { transition-delay: 0.32s; }
.fade-in--d5 { transition-delay: 0.40s; }
.fade-in--d6 { transition-delay: 0.48s; }

/* ---- ACCESSIBILITY UTILITIES ---- */
/* Visually hidden but accessible to screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .fade-in { transition: none; opacity: 1; transform: none; }
  .btn, .card, .nav-link { transition: none; }
}
