/* ============================================================
   FLOWIE ROI CALCULATOR — Design System v3
   Aligned with flowie-website/src/app/globals.css (May 2026)
   Brand Blue + Gold + Beige · Geist Sans
   ============================================================ */

:root {
  /* ─── Brand colors ─── */
  --brand-blue: #222878;
  --brand-blue-dark: #1a1f5e;
  --brand-blue-light: #4a52a8;
  --gold: #F2D599;
  --gold-dark: #b8922e;

  /* ─── Beige scale ─── */
  --beige-light: #F4F1EE;
  --beige-medium: #EAE6E1;
  --beige-dark: #DDD6CD;
  --muted: #5F6672;

  /* ─── Dark gradient (footer / CTA) ─── */
  --gradient-start: #0d1033;
  --gradient-mid: #141a4f;
  --gradient-end: #0f1340;

  /* ─── Semantic ─── */
  --success: #008236;
  --success-light: #F0FDF4;
  --error: #DC2626;
  --white: #FFFFFF;

  /* ─── Aliases (preserve app.js class names) ─── */
  --primary: var(--brand-blue);
  --primary-dark: var(--brand-blue-dark);
  --primary-light: var(--brand-blue-light);
  --secondary: var(--success);
  --secondary-dark: #006626;
  --accent: var(--gold);
  --dark: var(--brand-blue);
  --gray-700: var(--brand-blue);
  --gray-600: var(--muted);
  --gray-500: var(--muted);
  --gray-400: var(--beige-dark);
  --gray-300: var(--beige-medium);
  --gray-200: var(--beige-medium);
  --gray-100: var(--beige-light);
  --gray-50: var(--beige-light);

  /* ─── Shadows (Flowie aesthetic) ─── */
  --shadow-xs: 0 1px 2px 0 rgb(34 40 120 / 0.04);
  --shadow-sm: 0 1px 3px 0 rgb(34 40 120 / 0.06), 0 1px 2px -1px rgb(34 40 120 / 0.04);
  --shadow:    0 4px 12px -2px rgb(34 40 120 / 0.08), 0 2px 4px -2px rgb(34 40 120 / 0.04);
  --shadow-md: 0 8px 20px -4px rgb(34 40 120 / 0.10), 0 4px 8px -4px rgb(34 40 120 / 0.06);
  --shadow-lg: 0 16px 32px -8px rgb(34 40 120 / 0.12), 0 8px 16px -6px rgb(34 40 120 / 0.08);

  /* ─── Radius ─── */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* ─── Container (Ramp-style, max-w-page) ─── */
  --container-max: 1536px;

  /* ─── Animation ─── */
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 300ms;
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
}

/* ============================================================
   RESET + BASE
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Geist', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--white);
  color: var(--brand-blue);
  line-height: 1.5;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

::selection {
  background: var(--gold);
  color: var(--brand-blue);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================================================
   CONTAINER
   ============================================================ */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 640px) {
  .container { padding: 0 24px; }
}

@media (min-width: 1024px) {
  .container { padding: 0 64px; }
}

/* ============================================================
   NAVBAR (matches flowie-website Navbar visual)
   ============================================================ */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--beige-dark);
}

.navbar-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 16px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

@media (min-width: 640px) { .navbar-inner { padding: 0 24px; } }
@media (min-width: 1024px) { .navbar-inner { padding: 0 64px; } }

.navbar-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity var(--duration-base) var(--ease-out);
}

.navbar-logo:hover { opacity: 0.7; }

.navbar-logo img { height: 28px; width: auto; }

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--brand-blue);
  padding: 8px 12px;
  border-radius: 8px;
  transition: background var(--duration-base) var(--ease-out);
}

.navbar-link:hover {
  background: var(--beige-light);
}

@media (max-width: 768px) {
  .navbar-link { display: none; }
}

/* Language toggle */
.lang-toggle {
  display: inline-flex;
  background: var(--beige-light);
  border-radius: 8px;
  padding: 3px;
}

.lang-toggle button {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 6px;
  transition: all var(--duration-fast) var(--ease-out);
}

.lang-toggle button.active {
  background: var(--brand-blue);
  color: var(--white);
}

/* ============================================================
   BUTTONS (matches flowie-website Button.tsx variants)
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 10px;
  min-height: 36px;
}

.btn:not(.btn-sm):not(.btn-lg) {
  padding: 12px 24px;
  font-size: 16px;
  border-radius: 12px;
  min-height: 44px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 18px;
  border-radius: 12px;
  min-height: 52px;
}

.btn-primary {
  background: var(--gold);
  color: var(--brand-blue);
}
.btn-primary:hover {
  background: #efc97e;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--brand-blue);
  color: var(--white);
}
.btn-secondary:hover {
  background: var(--brand-blue-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--brand-blue);
  border-color: var(--brand-blue);
}
.btn-ghost:hover {
  background: var(--brand-blue);
  color: var(--white);
}

.btn-outline-dark {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.25);
}
.btn-outline-dark:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.5);
}

.btn-block { width: 100%; }

.btn .badge {
  background: rgba(34, 40, 120, 0.12);
  color: var(--brand-blue);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 4px;
}
.btn-secondary .badge {
  background: rgba(255, 255, 255, 0.18);
  color: var(--white);
}

/* ============================================================
   PAGE HEADER (kicker + h1 + subtitle, like flowie-website)
   ============================================================ */

.page-header {
  background: var(--beige-light);
  padding: 64px 0 56px;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px;
  opacity: 0.025;
  pointer-events: none;
}

@media (min-width: 768px) {
  .page-header { padding: 96px 0 80px; }
}

.kicker {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 20px;
}

.kicker-sm {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.kicker-light {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

.page-header h1 {
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--brand-blue);
  max-width: 24ch;
  margin-bottom: 20px;
}

.page-header h1 .text-muted {
  color: var(--muted);
  font-weight: 500;
}

.subtitle {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.6;
  color: var(--muted);
  max-width: 56ch;
  font-weight: 400;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */

.main-content {
  padding: 56px 16px;
}

@media (min-width: 640px) { .main-content { padding: 56px 24px; } }
@media (min-width: 1024px) { .main-content { padding: 64px 64px; } }

.main-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 1024px) {
  .main-layout {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 32px;
    align-items: start;
  }
}

.left-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.right-panel {
  position: sticky;
  top: 88px;
}

@media (max-width: 1023px) {
  .right-panel { position: relative; top: 0; }
}

/* ============================================================
   CARDS (matches flowie-website Card.tsx)
   ============================================================ */

.card {
  background: var(--white);
  border: 1px solid rgba(221, 214, 205, 0.5); /* beige-dark / 50 */
  border-radius: 16px;
  overflow: hidden;
  transition: border-color var(--duration-base), box-shadow var(--duration-base);
}

.card:hover {
  border-color: rgba(242, 213, 153, 0.5); /* gold / 50 */
  box-shadow: var(--shadow-lg);
}

.card-header {
  padding: 24px 24px 0;
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 0 24px 24px;
  border-top: 1px solid rgba(221, 214, 205, 0.3);
  padding-top: 16px;
  margin-top: 8px;
}

@media (min-width: 768px) {
  .card-header { padding: 32px 32px 0; }
  .card-body { padding: 32px; }
  .card-footer { padding: 16px 32px 32px; }
}

/* ============================================================
   ROI SUMMARY (the big sticky-ish card on the left)
   ============================================================ */

.roi-summary-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--brand-blue);
  line-height: 1.2;
}

.roi-total {
  text-align: center;
  padding: 16px 0 24px;
}

.roi-total-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.roi-total-value {
  font-family: 'Geist', sans-serif;
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--brand-blue);
  line-height: 1.05;
  margin: 8px 0 4px;
  font-variant-numeric: tabular-nums;
}

.roi-total-sublabel {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}

.roi-breakdown {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0;
  padding-top: 24px;
  border-top: 1px solid var(--beige-medium);
}

.roi-breakdown-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px;
  align-items: center;
  font-size: 14px;
}

.roi-breakdown-icon {
  font-size: 18px;
}

.roi-breakdown-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.roi-breakdown-name {
  font-weight: 500;
  color: var(--brand-blue);
  font-size: 13px;
}

.roi-breakdown-bar {
  background: var(--beige-medium);
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
}

.roi-breakdown-bar-fill {
  height: 100%;
  background: var(--brand-blue);
  border-radius: 999px;
  transition: width 400ms var(--ease-out);
}

.roi-breakdown-value {
  font-weight: 700;
  color: var(--success);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.roi-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.roi-metric {
  background: var(--beige-light);
  padding: 16px;
  border-radius: 12px;
  text-align: center;
}

.roi-metric-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--brand-blue);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.roi-metric-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

/* ============================================================
   MODULE CARDS (each module = expandable card)
   ============================================================ */

.modules-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.module-card {
  background: var(--white);
  border: 1px solid rgba(221, 214, 205, 0.5);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color var(--duration-base), box-shadow var(--duration-base);
}

.module-card:hover {
  border-color: rgba(242, 213, 153, 0.5);
  box-shadow: var(--shadow-md);
}

.module-card.expanded {
  border-color: var(--brand-blue);
  box-shadow: var(--shadow-md);
}

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  cursor: pointer;
  transition: background var(--duration-base);
  gap: 12px;
}

.module-header:hover {
  background: var(--beige-light);
}

.module-info {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.module-icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--beige-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.module-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-blue);
  letter-spacing: -0.005em;
}

.module-description {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.module-savings {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.module-savings-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--success);
  font-variant-numeric: tabular-nums;
}

.module-toggle {
  color: var(--muted);
  transition: transform var(--duration-base);
  font-size: 12px;
  width: 24px;
  text-align: center;
}

.module-card.expanded .module-toggle {
  transform: rotate(180deg);
}

.module-body {
  display: none;
  padding: 0 20px 20px;
  border-top: 1px solid var(--beige-medium);
}

.module-card.expanded .module-body {
  display: block;
}

/* ============================================================
   FORM FIELDS (matches flowie-website Input.tsx)
   ============================================================ */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 20px;
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--brand-blue);
}

.form-input,
.form-select {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--brand-blue);
  background: var(--white);
  border: 1px solid var(--beige-dark);
  border-radius: 10px;
  transition: border-color var(--duration-base), box-shadow var(--duration-base);
}

.form-input::placeholder { color: var(--muted); }

.form-input:hover,
.form-select:hover {
  border-color: var(--brand-blue-light);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(34, 40, 120, 0.12);
}

/* ============================================================
   AGENT PANEL (right-side AI chat)
   ============================================================ */

.agent-panel {
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  min-height: 480px;
}

.agent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--beige-medium);
  background: var(--beige-light);
}

.agent-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.agent-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand-blue);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.agent-title-line {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-blue);
  line-height: 1.2;
}

.agent-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.agent-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.agent-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.agent-message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.agent-message.user {
  align-self: flex-end;
  background: var(--brand-blue);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.agent-message.assistant {
  align-self: flex-start;
  background: var(--beige-light);
  color: var(--brand-blue);
  border-bottom-left-radius: 4px;
}

.agent-input-area {
  display: flex;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid var(--beige-medium);
  background: var(--white);
}

.agent-input {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--brand-blue);
  background: var(--beige-light);
  border: 1px solid transparent;
  border-radius: 10px;
  transition: all var(--duration-base);
}

.agent-input::placeholder { color: var(--muted); }

.agent-input:focus {
  outline: none;
  background: var(--white);
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(34, 40, 120, 0.12);
}

.agent-send {
  padding: 10px 14px;
  min-height: 0;
  border-radius: 10px;
}

/* ============================================================
   CTA BANNER (above footer, gold-on-dark)
   ============================================================ */

.cta-banner {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-mid), var(--gradient-end));
  color: var(--white);
  padding: 64px 0;
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 70%);
}

@media (min-width: 768px) {
  .cta-banner { padding: 96px 0; }
}

.cta-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}

@media (min-width: 768px) {
  .cta-inner {
    grid-template-columns: 1fr auto;
    gap: 48px;
  }
}

.cta-banner h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 12px;
}

.cta-banner p {
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
  max-width: 56ch;
}

.cta-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================================
   FOOTER (matches flowie-website Footer.tsx visual)
   ============================================================ */

.footer {
  background: #0d1033;
  color: var(--white);
  padding: 64px 0 32px;
  position: relative;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 26, 79, 0.3) 0%, transparent 50%, rgba(0, 0, 0, 0.2) 100%);
  pointer-events: none;
}

.footer .container {
  position: relative;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 32px;
  }
}

.footer-brand img { margin-bottom: 16px; }

.footer-tagline {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
  max-width: 32ch;
}

.footer-col {
  display: flex;
  flex-direction: column;
}

.footer-col-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 16px;
}

.footer-col a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  padding: 6px 0;
  transition: color var(--duration-base);
}

.footer-col a:hover {
  color: var(--gold);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 32px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

/* ============================================================
   ACCESSIBILITY + RESPONSIVE
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
   FLOWIE-WEBSITE PARITY UTILITIES
   ============================================================ */

/* Gradient bg + dot grid + noise — copied from flowie-website globals */
.bg-flowie-gradient {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-mid), var(--gradient-end));
}

.bg-dot-grid {
  position: relative;
}
.bg-dot-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 70%);
}

@media (max-width: 640px) {
  .bg-dot-grid::before { background-size: 32px 32px; }
}

/* Gold shimmer text */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.text-shimmer-gold {
  background: linear-gradient(
    110deg,
    var(--gold) 0%,
    #ffe8b8 25%,
    var(--gold) 50%,
    #ffe8b8 75%,
    var(--gold) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s linear infinite;
  display: inline-block;
}

/* Btn shine sweep */
.btn-shine {
  position: relative;
  overflow: hidden;
}
.btn-shine::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 100%
  );
  animation: btnShine 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes btnShine {
  0% { left: -100%; }
  60%, 100% { left: 150%; }
}

/* Aurora glow blobs */
@keyframes aurora {
  0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0.45; }
  25% { transform: translate(40px, -30px) rotate(8deg); opacity: 0.65; }
  50% { transform: translate(-30px, 20px) rotate(-5deg); opacity: 0.5; }
  75% { transform: translate(20px, 40px) rotate(4deg); opacity: 0.7; }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.06); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Avatar pulse */
@keyframes avatarPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 213, 153, 0.45); }
  50% { box-shadow: 0 0 0 10px rgba(242, 213, 153, 0); }
}

/* Digit flip */
@keyframes digitFlip {
  0% { transform: rotateX(0deg); opacity: 1; }
  50% { transform: rotateX(-90deg); opacity: 0.4; }
  100% { transform: rotateX(0deg); opacity: 1; }
}

/* Wave-in for grids */
@keyframes waveIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Bounce-in chip */
@keyframes chipPop {
  0% { opacity: 0; transform: translateY(8px) scale(0.94); }
  60% { opacity: 1; transform: translateY(-2px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger {
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--i, 0) * 60ms);
}
.reveal-stagger.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ============================================================
   HERO DARK (replaces beige page-header)
   ============================================================ */

.hero-dark {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: 88px 0 96px;
  isolation: isolate;
}

@media (min-width: 768px) {
  .hero-dark { padding: 112px 0 120px; }
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 64px;
  }
}

.hero-content { max-width: 720px; }

.hero-title {
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: #fff;
  margin: 18px 0 22px;
}

.hero-subtitle {
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.72);
  max-width: 60ch;
  margin-bottom: 30px;
}

/* Aurora blobs */
.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
.aurora-blob-1 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(242, 213, 153, 0.28), transparent 70%);
  top: -180px; left: -120px;
  animation: aurora 18s ease-in-out infinite;
}
.aurora-blob-2 {
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(74, 82, 168, 0.55), transparent 70%);
  bottom: -160px; right: -120px;
  animation: aurora 22s ease-in-out infinite reverse;
}
.aurora-blob-3 {
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(242, 213, 153, 0.15), transparent 70%);
  top: 40%; left: 50%;
  animation: glowPulse 8s ease-in-out infinite;
}

/* ============================================================
   QUICK TOPIC CHIPS — gold-bordered, hover glow
   ============================================================ */

.quick-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.topic-chip {
  position: relative;
  padding: 9px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(242, 213, 153, 0.35);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gold);
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(8px);
  animation: chipPop 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(0.4s + var(--i, 0) * 70ms);
}

.topic-chip:hover {
  background: rgba(242, 213, 153, 0.12);
  border-color: var(--gold);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -6px rgba(242, 213, 153, 0.4);
}

.topic-chip:active {
  transform: translateY(0);
}

/* ============================================================
   COUNTDOWN PANEL
   ============================================================ */

.countdown-panel {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(242, 213, 153, 0.22);
  border-radius: 20px;
  padding: 28px 24px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.4);
}

.countdown-panel::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(242, 213, 153, 0.6), transparent 50%, rgba(242, 213, 153, 0.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.countdown-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
  margin-bottom: 18px;
}

.countdown-grid {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
}

.countdown-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
}

.countdown-digit {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 600;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 24px rgba(242, 213, 153, 0.25);
  transform-origin: center;
  perspective: 400px;
}

.countdown-digit.flip {
  animation: digitFlip 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.countdown-unit {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 8px;
}

.countdown-sep {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  font-weight: 400;
  color: rgba(242, 213, 153, 0.5);
  line-height: 1;
  margin-top: 4px;
  animation: glowPulse 2s ease-in-out infinite;
}

.countdown-progress {
  margin-top: 24px;
}

.countdown-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.countdown-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #ffe8b8, var(--gold));
  background-size: 200% 100%;
  border-radius: 999px;
  width: 0%;
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  animation: shimmer 4s linear infinite;
  box-shadow: 0 0 16px rgba(242, 213, 153, 0.5);
}

.countdown-progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
}

.countdown-progress-meta #cd-progress-pct {
  color: var(--gold);
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   REFORM TIMELINE SECTION
   ============================================================ */

.reform-timeline-section {
  background: var(--white);
  padding: 80px 0;
  position: relative;
}

@media (min-width: 768px) {
  .reform-timeline-section { padding: 96px 0; }
}

.section-eyebrow {
  text-align: center;
  margin-bottom: 56px;
}

.section-eyebrow .kicker-sm {
  display: inline-block;
  color: var(--gold-dark);
  margin-bottom: 14px;
}

.section-title {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--brand-blue);
  max-width: 22ch;
  margin: 0 auto 12px;
}

.section-lead {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--muted);
  max-width: 60ch;
  margin: 0 auto;
}

.timeline-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 32px 0 24px;
  margin-bottom: 56px;
}

@media (max-width: 640px) {
  .timeline-track {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.timeline-line {
  position: absolute;
  top: 56px;
  left: 12.5%;
  right: 12.5%;
  height: 2px;
  background: var(--beige-medium);
  z-index: 0;
}

.timeline-line-fill {
  position: absolute;
  top: 56px;
  left: 12.5%;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-dark));
  z-index: 1;
  width: 0%;
  transition: width 1.6s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 12px rgba(242, 213, 153, 0.6);
}

@media (max-width: 640px) {
  .timeline-line, .timeline-line-fill { display: none; }
}

.timeline-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 2;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--node-i, 0) * 120ms);
}
.timeline-node.in-view {
  opacity: 1;
  transform: translateY(0);
}

.timeline-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--beige-dark);
  margin-bottom: 16px;
  position: relative;
  transition: all 0.3s ease;
}

.timeline-node[data-state="past"] .timeline-dot {
  background: var(--gold);
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 4px rgba(242, 213, 153, 0.2);
}

.timeline-node[data-state="next"] .timeline-dot {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 6px rgba(34, 40, 120, 0.15);
  animation: avatarPulse 2s ease-in-out infinite;
}

.timeline-node[data-state="future"] .timeline-dot {
  background: var(--white);
  border: 2px dashed var(--beige-dark);
}

.timeline-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--brand-blue);
  margin-bottom: 6px;
}

.timeline-event {
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
  max-width: 22ch;
  font-weight: 500;
}

.timeline-node[data-state="next"] .timeline-event {
  color: var(--brand-blue);
  font-weight: 600;
}

.timeline-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 10px;
  background: var(--brand-blue);
  color: var(--gold);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   TRUST CARDS GRID (under timeline)
   ============================================================ */

.trust-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 24px;
}

@media (min-width: 768px) {
  .trust-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}

.trust-card {
  background: var(--white);
  border: 1px solid var(--beige-medium);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s, box-shadow 0.3s;
  transition-delay: calc(var(--i, 0) * 80ms);
  position: relative;
  overflow: hidden;
}
.trust-card.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.trust-card:hover {
  border-color: var(--gold);
  box-shadow: 0 8px 24px -8px rgba(242, 213, 153, 0.4);
  transform: translateY(-2px);
}

.trust-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--beige-light);
  color: var(--brand-blue);
  margin-bottom: 12px;
}

.trust-card-value {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--brand-blue);
  margin-bottom: 4px;
}

.trust-card-label {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* ============================================================
   CHAT WRAP — main interactive section
   ============================================================ */

.chat-wrap {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
}

.chat-glow {
  position: absolute;
  inset: -60px -40px;
  background: radial-gradient(ellipse at center, rgba(242, 213, 153, 0.18), transparent 65%);
  pointer-events: none;
  z-index: -1;
  filter: blur(40px);
}

.chat-card {
  display: flex;
  flex-direction: column;
  height: 70vh;
  min-height: 560px;
  max-height: 760px;
  border: 1px solid rgba(221, 214, 205, 0.7);
  border-radius: 20px;
  box-shadow: 0 32px 64px -24px rgba(34, 40, 120, 0.2),
              0 16px 32px -16px rgba(34, 40, 120, 0.12);
  overflow: hidden;
  transition: box-shadow 0.4s ease, border-color 0.4s ease, transform 0.4s ease;
}

.chat-card:hover {
  border-color: rgba(242, 213, 153, 0.5);
  box-shadow: 0 36px 72px -24px rgba(34, 40, 120, 0.24),
              0 20px 40px -16px rgba(242, 213, 153, 0.18);
}

#flowie-einvoicing-expert {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#flowie-einvoicing-expert .flowie-chat-widget {
  height: 100% !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* ============================================================
   USE CASES SECTION
   ============================================================ */

.usecases-section {
  background: var(--beige-light);
  padding: 80px 0;
  position: relative;
}

@media (min-width: 768px) {
  .usecases-section { padding: 96px 0; }
}

.usecases-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 56px;
}

@media (min-width: 640px) {
  .usecases-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .usecases-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}

.usecase-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--beige-medium);
  border-radius: 16px;
  padding: 22px 20px;
  text-align: left;
  cursor: pointer;
  transition: all var(--duration-slow) var(--ease-out);
  position: relative;
  overflow: hidden;
  min-height: 140px;
}

.usecase-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-dark));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.usecase-card:hover {
  border-color: rgba(242, 213, 153, 0.6);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.usecase-card:hover::before {
  transform: scaleX(1);
}

.usecase-tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--beige-light);
  color: var(--gold-dark);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 999px;
}

.usecase-card:hover .usecase-tag {
  background: var(--gold);
  color: var(--brand-blue);
}

.usecase-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-blue);
  letter-spacing: -0.01em;
  line-height: 1.35;
  flex: 1;
}

.usecase-arrow {
  font-size: 18px;
  color: var(--gold-dark);
  margin-top: auto;
  transition: transform 0.3s ease;
  align-self: flex-end;
}

.usecase-card:hover .usecase-arrow {
  transform: translateX(6px);
  color: var(--brand-blue);
}

/* ============================================================
   CTA BANNER — enhanced
   ============================================================ */

.cta-banner {
  position: relative;
  isolation: isolate;
}

.cta-banner > .container {
  position: relative;
  z-index: 1;
}

.cta-banner .reveal {
  /* keep reveal animation working in CTA */
}
