/* DentalFlow landing — custom styles layered on top of Tailwind CDN */

:root {
  --brand: #432177;
  --brand-700: #36185f;
  --brand-600: #4e2785;
  --brand-500: #5c2e9c;
  --brand-400: #7a4fbf;
  --brand-300: #b39ad6;
  --brand-100: #ede7f6;
  --brand-50: #f5f1fb;
  --bg: #fbfaff;
  --ink: #1a1530;
  --ink-2: #3f3857;
  --ink-3: #6b6583;
  --line: rgba(67, 33, 119, 0.10);
  --line-strong: rgba(67, 33, 119, 0.16);
  --grad: linear-gradient(135deg, #432177 0%, #6236b3 50%, #8b5cf6 100%);
  --grad-horiz: linear-gradient(90deg, #432177 0%, #6236b3 50%, #8b5cf6 100%);
}

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

.font-serif-it { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.font-mono-df { font-family: "JetBrains Mono", ui-monospace, monospace; font-feature-settings: "ss01","cv11"; }

.eyebrow {
  font-size: 11px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.3em; color: var(--brand); opacity: 0.75;
}

.bg-grid {
  background-image: radial-gradient(rgba(67,33,119,0.08) 1px, transparent 1px);
  background-size: 28px 28px;
}

.aurora {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.5;
  pointer-events: none; mix-blend-mode: multiply;
  animation: drift 22s ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { transform: translate(0,0) scale(1); }
  50%  { transform: translate(30px,-40px) scale(1.08); }
  100% { transform: translate(-20px,20px) scale(0.95); }
}

.banner-shimmer {
  background: linear-gradient(90deg, #432177 0%, #6236b3 25%, #8b5cf6 50%, #6236b3 75%, #432177 100%);
  background-size: 300% 100%;
  animation: shimmer 9s linear infinite;
}
@keyframes shimmer { 0% { background-position: 0% 50%; } 100% { background-position: 300% 50%; } }
.banner-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 10px rgba(255,255,255,.9);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 0.5; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.2); } }

.nav-sticky {
  position: sticky; top: 0; z-index: 50;
  transition: background-color 200ms ease, box-shadow 200ms ease, backdrop-filter 200ms ease;
}
.nav-sticky.scrolled {
  background: rgba(251, 250, 255, 0.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  box-shadow: 0 1px 0 var(--line), 0 20px 40px -30px rgba(67,33,119,.25);
}

.lang-chip {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  padding: 4px 8px; border-radius: 6px; color: var(--ink-3);
  transition: all 150ms ease;
}
.lang-chip:hover { color: var(--brand); background: var(--brand-50); }
.lang-chip.active { color: #fff; background: var(--brand); }

.lang-switch-mobile { position: relative; }
.lang-dd-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--line);
  color: var(--ink-2);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}
.lang-dd-btn:hover { background: #fff; border-color: var(--line-strong); }
.lang-dd-btn .flag {
  font-size: 16px;
  line-height: 1;
  display: inline-block;
  margin-right: 2px;
}
html[lang="fr"] .lang-dd-btn .flag { margin-left: -3px; margin-right: 5px; }
.lang-dd-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 20px 40px -12px rgba(67,33,119,.25), 0 2px 4px rgba(67,33,119,.06);
  padding: 6px;
  display: none;
  z-index: 60;
}
.lang-dd-menu.open { display: block; }
.lang-dd-item {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  text-align: left;
  transition: background 120ms ease;
}
.lang-dd-item:hover { background: var(--brand-50); color: var(--brand); }
.lang-dd-item.active { background: var(--brand); color: #fff; }
.lang-dd-item .flag { font-size: 16px; line-height: 1; }

.nav-sections { flex-wrap: nowrap; }
.nav-link {
  position: relative;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink-2);
  transition: color 150ms ease, background-color 150ms ease;
  white-space: nowrap;
}
.nav-link:hover { color: var(--brand); background: var(--brand-50); }
.nav-link.active {
  color: var(--brand);
  background: var(--brand-50);
  font-weight: 600;
}
@media (max-width: 1400px) {
  .nav-sections { gap: 2px; font-size: 12px; }
  .nav-link { padding: 5px 7px; }
}
@media (max-width: 1200px) {
  .nav-sections { font-size: 11.5px; }
  .nav-link { padding: 4px 6px; }
}

.btn-primary {
  background: var(--grad); color: #fff;
  font-weight: 600; letter-spacing: -0.005em;
  border-radius: 12px; padding: 12px 20px;
  box-shadow: 0 10px 30px -10px rgba(67,33,119,.55), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform 200ms cubic-bezier(.2,.7,.2,1), box-shadow 200ms ease;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 44px -12px rgba(67,33,119,.7), inset 0 1px 0 rgba(255,255,255,.3);
}
.btn-ghost {
  border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 11px 18px;
  color: var(--ink); font-weight: 500;
  transition: all 200ms ease;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.6);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); background: #fff; }

.glass {
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 20px 60px -30px rgba(67,33,119,.25);
}

.browser {
  border: 1px solid var(--line-strong);
  border-radius: 16px; background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,1) inset, 0 40px 120px -30px rgba(67,33,119,.35), 0 2px 4px rgba(67,33,119,.05);
}
.browser-bar {
  height: 34px; display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  background: linear-gradient(180deg, #f7f5fb 0%, #efebf6 100%);
  border-bottom: 1px solid var(--line);
}
.tl { width: 10px; height: 10px; border-radius: 50%; }
.tl-r { background: #ff5f57; } .tl-y { background: #febc2e; } .tl-g { background: #28c840; }
.browser-url {
  flex: 1; height: 22px; background: #fff;
  border: 1px solid var(--line); border-radius: 6px;
  font-family: "JetBrains Mono", monospace; font-size: 11px;
  color: var(--ink-3); padding: 0 8px;
  display: flex; align-items: center; gap: 6px;
}
.browser-body { position: relative; background: #fff; }
.browser-body img { display: block; width: 100%; height: auto; }

.ghost-cursor {
  position: absolute; width: 20px; height: 20px;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(67,33,119,.35));
  z-index: 5;
}

.rv { opacity: 0; transform: translateY(24px); transition: opacity 800ms cubic-bezier(.2,.7,.2,1), transform 800ms cubic-bezier(.2,.7,.2,1); }
.rv.in { opacity: 1; transform: none; }
.rv-delay-1 { transition-delay: 60ms; }
.rv-delay-2 { transition-delay: 120ms; }
.rv-delay-3 { transition-delay: 180ms; }
.rv-delay-4 { transition-delay: 240ms; }

.cta-final {
  position: relative; overflow: hidden;
  background: var(--grad);
  border-radius: 28px; color: #fff;
  padding: 64px 48px;
  box-shadow: 0 40px 100px -30px rgba(67,33,119,.6);
}
.cta-final::before {
  content: ""; position: absolute; inset: -50%;
  background: conic-gradient(from 0deg, rgba(255,255,255,.14), transparent 30%, rgba(255,255,255,.08) 60%, transparent 90%);
  animation: spin 10s linear infinite; opacity: 0.6;
}
@keyframes spin { to { transform: rotate(360deg); } }

.cta-btn-white {
  background: #fff; color: var(--brand);
  font-weight: 600; border-radius: 14px;
  padding: 14px 24px;
  display: inline-flex; align-items: center; gap: 10px;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.cta-btn-white:hover { transform: translateY(-1px) scale(1.01); }

.cta-btn-outline {
  background: transparent; color: #fff;
  border: 1.5px solid rgba(255,255,255,.6);
  font-weight: 600; border-radius: 14px;
  padding: 14px 24px;
  display: inline-flex; align-items: center; gap: 10px;
  transition: all 200ms ease;
}
.cta-btn-outline:hover {
  background: rgba(255,255,255,.15); border-color: #fff;
  transform: translateY(-1px);
}

#demo-modal.open { display: flex !important; }
#demo-modal .btn-primary { padding: 14px 20px; }

.float-card {
  position: absolute;
  background: rgba(255,255,255,.95);
  border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px;
  box-shadow: 0 20px 40px -15px rgba(67,33,119,.35);
  backdrop-filter: blur(8px);
  animation: floaty 7s ease-in-out infinite;
}
.float-card.delay-1 { animation-delay: -2.5s; }
.float-card.delay-2 { animation-delay: -5s; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.section-rail {
  position: fixed; right: 20px; top: 50%;
  transform: translateY(-50%); z-index: 40;
  mix-blend-mode: multiply;
  display: flex; flex-direction: column; gap: 12px;
}
.section-rail a {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(67,33,119,.25);
  transition: all 250ms ease;
}
.section-rail a.active { background: var(--brand); height: 18px; border-radius: 4px; }
@media (max-width: 900px) { .section-rail { display: none; } }

#scroll-progress {
  position: fixed; top: 0; left: 0;
  height: 2px; width: 0%;
  background: var(--grad-horiz);
  z-index: 100;
  transition: width 80ms linear;
}

.spark-path {
  stroke-dasharray: 300; stroke-dashoffset: 300;
  animation: draw 2.2s ease-out forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  .banner-shimmer, .aurora, .cta-final::before,
  .float-card, .spark-path { animation: none !important; }
  .rv { opacity: 1 !important; transform: none !important; }
}

.tilt { transition: transform 400ms cubic-bezier(.2,.7,.2,1); transform-style: preserve-3d; }
.tilt:hover { transform: perspective(1200px) rotateX(1deg) rotateY(-1deg) translateY(-4px); }

::selection { background: rgba(139,92,246,.28); color: var(--brand-700); }

/* Mobile-only hero tweaks */
@media (max-width: 640px) {
  /* Default (DE/EN): tutto centrato */
  .hero-col { text-align: center; }
  .hero-col > .rv:first-child { display: inline-flex; }
  .hero-col h1,
  .hero-col p[data-i18n="hero_sub"] { margin-left: auto; margin-right: auto; }
  .hero-col p[data-i18n="hero_sub"] { max-width: 100% !important; }

  .hero-meta-row {
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-kpi-grid {
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100%;
    max-width: 340px !important;
  }

  /* IT / FR: testi più lunghi → allinea a sinistra per evitare tagli */
  html[lang="it"] .hero-col,
  html[lang="fr"] .hero-col {
    text-align: left !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: 100% !important;
  }
  html[lang="it"] .hero-col > *,
  html[lang="fr"] .hero-col > * {
    margin-left: 0 !important;
    max-width: 100% !important;
  }
  html[lang="it"] .hero-col h1,
  html[lang="fr"] .hero-col h1,
  html[lang="it"] .hero-col p[data-i18n="hero_sub"],
  html[lang="fr"] .hero-col p[data-i18n="hero_sub"] {
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: left !important;
  }
  html[lang="it"] .hero-meta-row,
  html[lang="fr"] .hero-meta-row {
    justify-content: flex-start !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  html[lang="it"] .hero-kpi-grid,
  html[lang="fr"] .hero-kpi-grid {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
  }
  html[lang="it"] .hero-col h1,
  html[lang="fr"] .hero-col h1 {
    font-size: clamp(28px, 8vw, 38px) !important;
    line-height: 1.08 !important;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
  html[lang="it"] .hero-col p[data-i18n="hero_sub"],
  html[lang="fr"] .hero-col p[data-i18n="hero_sub"] {
    font-size: 14.5px !important;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
  html[lang="it"] .hero-meta-row,
  html[lang="fr"] .hero-meta-row {
    font-size: 11.5px !important;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  html[lang="it"] .hero-meta-row > span,
  html[lang="fr"] .hero-meta-row > span {
    max-width: 100%;
    flex-wrap: wrap;
  }
  html[lang="it"] .hero-kpi-grid .glass > div:last-child,
  html[lang="fr"] .hero-kpi-grid .glass > div:last-child {
    font-size: 8.5px !important;
    letter-spacing: 0.05em !important;
  }
  /* CTA row: bottoni restano centrati sempre */
  html[lang="it"] .hero-cta-row,
  html[lang="fr"] .hero-cta-row { align-items: center; }

  /* Dashboard mockup: centra esattamente nella viewport */
  html[lang="it"] [data-video="hero"],
  html[lang="fr"] [data-video="hero"] {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    position: relative !important;
    left: 0 !important;
    right: 0 !important;
  }
  html[lang="it"] [data-video="hero"] .browser,
  html[lang="fr"] [data-video="hero"] .browser {
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
    position: static !important;
  }
  .hero-kpi-grid .glass {
    padding: 12px 10px;
    min-width: 0;
    text-align: center;
  }
  .hero-kpi-grid .glass > div:first-child { font-size: 22px !important; }
  .hero-kpi-grid .glass > div:last-child {
    font-size: 9px !important;
    letter-spacing: 0.08em !important;
    white-space: normal;
    word-break: break-word;
    line-height: 1.25;
  }

  .hero-cta-row {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
  }
  .hero-cta-row .btn-primary,
  .hero-cta-row .btn-ghost {
    display: flex;
    width: 100%;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
    align-items: center;
    padding: 12px 16px;
    box-sizing: border-box;
    white-space: nowrap;
    text-align: center;
  }
  .hero-cta-row .btn-primary span,
  .hero-cta-row .btn-ghost span { white-space: nowrap; }
  .hero-cta-row > a[href="#sec-01"] {
    width: 100%;
    max-width: 320px;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }

  .demo-quick-hero {
    display: flex !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100%;
    max-width: 320px !important;
    box-sizing: border-box;
    padding-left: 10px !important;
  }
  .demo-quick-hero > svg { display: none; }
  .demo-quick-hero input {
    min-width: 0;
    flex: 1 1 0;
    text-align: center;
  }
  .demo-quick-hero input::placeholder { text-align: center; }
  .demo-quick-hero .btn-primary {
    flex: none;
    padding: 8px 14px !important;
  }
}
