/* ============================================================
   FLOWIE ROI CALCULATOR — Premium Edition v4
   Design system aligned with flowie-website (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-light: #ffe8b8;
  --gold-dark: #b8922e;

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

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

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

  /* ─── Aliases ─── */
  --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 ─── */
  --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);
  --shadow-xl: 0 24px 48px -12px rgb(34 40 120 / 0.18), 0 12px 24px -8px rgb(34 40 120 / 0.10);
  --shadow-glow-gold: 0 0 32px rgba(242, 213, 153, 0.35), 0 0 80px rgba(242, 213, 153, 0.15);
  --shadow-glow-blue: 0 0 32px rgba(34, 40, 120, 0.25), 0 0 80px rgba(34, 40, 120, 0.10);

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

  /* ─── Container ─── */
  --container-max: 1536px;

  /* ─── Animation ─── */
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 300ms;
  --duration-slower: 500ms;
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

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

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; }

/* ============================================================
   ANIMATIONS — premium library
   ============================================================ */

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes btnShine {
  0% { left: -100%; }
  60%, 100% { left: 150%; }
}

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

@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(1.08); }
}

@keyframes aurora {
  0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0.35; }
  25% { transform: translate(30px, -20px) rotate(5deg); opacity: 0.55; }
  50% { transform: translate(-20px, 10px) rotate(-3deg); opacity: 0.45; }
  75% { transform: translate(10px, 30px) rotate(2deg); opacity: 0.6; }
}

@keyframes digitFlip {
  0% { transform: rotateX(0deg); }
  50% { transform: rotateX(-90deg); opacity: 0.5; }
  100% { transform: rotateX(0deg); opacity: 1; }
}

@keyframes waveIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes barFill {
  from { width: 0; }
}

@keyframes ringPulse {
  0% { box-shadow: 0 0 0 0 rgba(242, 213, 153, 0.5); }
  70% { box-shadow: 0 0 0 14px rgba(242, 213, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(242, 213, 153, 0); }
}

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-6px); opacity: 1; }
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ============================================================
   UTILITIES
   ============================================================ */

.text-shimmer-gold {
  background: linear-gradient(
    110deg,
    var(--gold) 0%,
    var(--gold-light) 25%,
    var(--gold) 50%,
    var(--gold-light) 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;
}

.text-shimmer-blue {
  background: linear-gradient(
    110deg,
    var(--brand-blue) 0%,
    var(--brand-blue-light) 50%,
    var(--brand-blue) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 6s linear infinite;
}

.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.45) 50%, transparent 100%);
  animation: btnShine 3.2s ease-in-out infinite;
  pointer-events: none;
}

.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.08) 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%);
}

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

.font-mono-num {
  font-feature-settings: 'tnum' on, 'lnum' on;
  font-variant-numeric: tabular-nums;
}

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

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

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

/* ============================================================
   NAVBAR
   ============================================================ */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(221, 214, 205, 0.6);
}

.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
   ============================================================ */

.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;
  position: relative;
  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: 14px;
  min-height: 56px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, #f0cf8c 100%);
  color: var(--brand-blue);
  box-shadow: 0 2px 8px rgba(242, 213, 153, 0.30), 0 1px 3px rgba(184, 146, 46, 0.15);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #efc97e 0%, var(--gold) 100%);
  box-shadow: var(--shadow-glow-gold), var(--shadow-md);
  transform: translateY(-2px);
}
.btn-primary:active { transform: translateY(0); }

.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.3);
  backdrop-filter: blur(8px);
}
.btn-outline-dark:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
}

.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 — premium animated hero
   ============================================================ */

.page-header {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-mid), var(--gradient-end));
  color: var(--white);
  padding: 96px 0 88px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

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

/* Particle canvas (drawn by JS) */
.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.55;
  pointer-events: none;
}

/* Aurora glow blobs */
.hero-aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: screen;
}

.hero-aurora-1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(242, 213, 153, 0.45), transparent 60%);
  top: -160px;
  right: -120px;
  animation: aurora 18s ease-in-out infinite;
}

.hero-aurora-2 {
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(74, 82, 168, 0.55), transparent 60%);
  bottom: -200px;
  left: -100px;
  animation: aurora 22s ease-in-out infinite reverse;
}

.hero-aurora-3 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(242, 213, 153, 0.30), transparent 60%);
  top: 40%;
  left: 35%;
  animation: glowPulse 8s ease-in-out infinite;
}

/* Dot grid overlay */
.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, black 30%, transparent 75%);
}

.page-header .container {
  z-index: 1;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 24px;
  padding: 8px 14px;
  background: rgba(242, 213, 153, 0.10);
  border: 1px solid rgba(242, 213, 153, 0.25);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  animation: fadeInUp 0.7s var(--ease-out) both;
}

.kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
  animation: glowPulse 2.5s ease-in-out infinite;
}

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

.kicker-light {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
  padding: 8px 14px;
  background: rgba(242, 213, 153, 0.10);
  border: 1px solid rgba(242, 213, 153, 0.22);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
.kicker-light::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
  animation: glowPulse 2.5s ease-in-out infinite;
}

.page-header h1 {
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--white);
  max-width: 22ch;
  margin-bottom: 24px;
  animation: fadeInUp 0.8s 0.1s var(--ease-out) both;
}

.page-header h1 .text-muted {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
  display: inline-block;
}

.subtitle {
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.72);
  max-width: 60ch;
  font-weight: 400;
  animation: fadeInUp 0.8s 0.2s var(--ease-out) both;
}

/* Hero metric pills */
.hero-stats {
  display: flex;
  gap: 16px;
  margin-top: 36px;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s 0.3s var(--ease-out) both;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  transition: all var(--duration-base) var(--ease-out);
}

.hero-stat:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(242, 213, 153, 0.4);
  transform: translateY(-2px);
}

.hero-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.hero-stat-label {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* Smooth fade-out from hero into main bg */
.page-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--white));
  pointer-events: none;
  z-index: 1;
}

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

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

@media (min-width: 640px) { .main-content { padding: 64px 24px; } }
@media (min-width: 1024px) { .main-content { padding: 72px 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;
  animation: fadeInUp 0.7s 0.1s var(--ease-out) both;
}

.right-panel {
  position: sticky;
  top: 88px;
  animation: slideInRight 0.7s 0.2s var(--ease-out) both;
}

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

/* ============================================================
   CARDS
   ============================================================ */

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

.card:hover {
  border-color: rgba(242, 213, 153, 0.5);
  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 — premium hero card
   ============================================================ */

.roi-summary {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #fbf9f6 100%);
  border: 1px solid rgba(221, 214, 205, 0.6);
  border-radius: 22px;
  overflow: hidden;
  isolation: isolate;
}

/* Aurora glow inside summary card */
.roi-summary::before {
  content: "";
  position: absolute;
  top: -100px;
  right: -80px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(242, 213, 153, 0.20), transparent 60%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  animation: aurora 20s ease-in-out infinite;
}

.roi-summary::after {
  content: "";
  position: absolute;
  bottom: -120px;
  left: -100px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(34, 40, 120, 0.10), transparent 60%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.roi-summary > * { position: relative; z-index: 1; }

.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: 24px 0 32px;
  position: relative;
}

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

.roi-total-value {
  font-family: 'Geist', sans-serif;
  font-size: clamp(3rem, 6.5vw, 4.75rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-light) 60%, var(--gold-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.0;
  margin: 12px 0 6px;
  font-variant-numeric: tabular-nums;
  display: inline-block;
  transition: transform 0.35s var(--ease-spring);
}

.roi-total-value.bumping {
  animation: digitFlip 0.45s var(--ease-out);
}

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

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

.roi-breakdown-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  align-items: center;
  font-size: 14px;
  padding: 8px;
  border-radius: 10px;
  transition: background var(--duration-base);
  animation: waveIn 0.5s var(--ease-out) both;
}

.roi-breakdown-item:hover {
  background: var(--beige-light);
}

.roi-breakdown-icon {
  font-size: 22px;
  text-align: center;
  filter: drop-shadow(0 2px 4px rgba(34, 40, 120, 0.10));
}

.roi-breakdown-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

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

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

.roi-breakdown-bar-fill {
  height: 100%;
  background: var(--brand-blue);
  border-radius: 999px;
  transition: width 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.roi-breakdown-bar-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  animation: shimmer 2.5s linear infinite;
  background-size: 200% 100%;
}

.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: 16px;
}

.roi-metric {
  position: relative;
  background: linear-gradient(180deg, var(--beige-light) 0%, #ede9e3 100%);
  padding: 18px 14px;
  border-radius: 14px;
  text-align: center;
  border: 1px solid rgba(221, 214, 205, 0.5);
  transition: all var(--duration-base) var(--ease-out);
  overflow: hidden;
}

.roi-metric::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(242, 213, 153, 0.12), transparent 60%);
  opacity: 0;
  transition: opacity var(--duration-base);
}

.roi-metric:hover {
  transform: translateY(-2px);
  border-color: rgba(242, 213, 153, 0.5);
  box-shadow: var(--shadow);
}

.roi-metric:hover::before { opacity: 1; }

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

.roi-metric-label {
  position: relative;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 6px;
}

/* ============================================================
   MODULE CARDS — premium expandable
   ============================================================ */

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

.module-card {
  background: var(--white);
  border: 1px solid rgba(221, 214, 205, 0.5);
  border-radius: 16px;
  overflow: hidden;
  transition: all var(--duration-base) var(--ease-out);
  position: relative;
  animation: waveIn 0.5s var(--ease-out) both;
}

/* Stagger animation for module cards */
.module-card:nth-child(1) { animation-delay: 0.10s; }
.module-card:nth-child(2) { animation-delay: 0.16s; }
.module-card:nth-child(3) { animation-delay: 0.22s; }
.module-card:nth-child(4) { animation-delay: 0.28s; }
.module-card:nth-child(5) { animation-delay: 0.34s; }
.module-card:nth-child(6) { animation-delay: 0.40s; }
.module-card:nth-child(7) { animation-delay: 0.46s; }

.module-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(242, 213, 153, 0.0), rgba(242, 213, 153, 0.06));
  opacity: 0;
  transition: opacity var(--duration-base);
  pointer-events: none;
  border-radius: inherit;
}

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

.module-card:hover::before { opacity: 1; }

.module-card.expanded {
  border-color: var(--brand-blue);
  box-shadow: 0 8px 24px rgba(34, 40, 120, 0.12), 0 2px 6px rgba(34, 40, 120, 0.08);
}

.module-card.expanded::before { opacity: 0; }

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

.module-header:hover {
  background: linear-gradient(90deg, var(--beige-light), transparent);
}

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

.module-icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--beige-light), var(--beige-medium));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-base) var(--ease-spring);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.module-card:hover .module-icon {
  transform: scale(1.08) rotate(-3deg);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: var(--shadow-glow-gold), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.module-card.expanded .module-icon {
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-light) 100%);
  color: var(--gold);
  box-shadow: var(--shadow-glow-blue);
}

.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: 10px;
  flex-shrink: 0;
}

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

.module-savings-value:not(:empty):not([data-zero]) {
  text-shadow: 0 0 12px rgba(0, 130, 54, 0.18);
}

.module-toggle {
  color: var(--muted);
  transition: transform var(--duration-slow) var(--ease-spring);
  font-size: 12px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--beige-light);
}

.module-card.expanded .module-toggle {
  transform: rotate(180deg);
  background: var(--brand-blue);
  color: var(--gold);
}

.module-body {
  display: none;
  padding: 0 20px 22px;
  border-top: 1px solid var(--beige-medium);
  background: linear-gradient(180deg, rgba(244, 241, 238, 0.4), transparent);
  animation: fadeIn 0.3s var(--ease-out);
}

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

/* ============================================================
   FORM FIELDS
   ============================================================ */

.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: 600;
  color: var(--brand-blue);
}

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

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

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

.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);
  background: var(--white);
}

/* Slider */
.form-slider {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  flex: 1;
  height: 24px;
}
.form-slider:focus { outline: none; }

.form-slider::-webkit-slider-runnable-track {
  height: 6px;
  background: var(--beige-dark);
  border-radius: 3px;
}
.form-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-blue);
  border: 3px solid var(--white);
  box-shadow: 0 4px 12px rgba(34, 40, 120, 0.20);
  margin-top: -8px;
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.form-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 16px rgba(34, 40, 120, 0.32);
}
.form-slider::-moz-range-track {
  height: 6px;
  background: var(--beige-dark);
  border-radius: 3px;
}
.form-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-blue);
  border: 3px solid var(--white);
  box-shadow: 0 4px 12px rgba(34, 40, 120, 0.20);
  cursor: grab;
  transition: transform 0.15s ease;
}

.slider-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-blue);
  font-variant-numeric: tabular-nums;
  min-width: 44px;
  text-align: right;
  padding: 4px 10px;
  background: var(--beige-light);
  border-radius: 8px;
}

/* ============================================================
   CALCULATION INFO (formula explanation)
   ============================================================ */

.calc-info-container {
  margin-top: 20px;
  border-top: 1px dashed var(--beige-dark);
  padding-top: 16px;
}

.calc-info-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 8px;
  transition: all var(--duration-base);
}

.calc-info-toggle:hover {
  background: var(--beige-light);
  color: var(--brand-blue);
}

.calc-info-arrow {
  font-size: 10px;
  transition: transform var(--duration-base);
}

.calc-info-toggle[aria-expanded="true"] .calc-info-arrow,
.calc-info-body.show + .calc-info-arrow {
  transform: rotate(180deg);
}

.calc-info-body {
  display: none;
  margin-top: 14px;
  padding: 16px 18px;
  background: var(--beige-light);
  border-radius: 12px;
  border: 1px solid rgba(221, 214, 205, 0.5);
  animation: fadeIn 0.3s var(--ease-out);
}

.calc-info-body.show { display: block; }

.calc-info-section { margin-bottom: 12px; }

.calc-info-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-blue);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.calc-info-item {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(221, 214, 205, 0.4);
}
.calc-info-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.calc-info-item-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-blue);
  margin-bottom: 4px;
}

.calc-info-item-formula {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--brand-blue);
  background: var(--white);
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 4px;
  border: 1px solid var(--beige-dark);
  word-wrap: break-word;
}

.calc-info-item-explanation {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.calc-info-benchmarks {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  padding: 10px 12px;
  background: rgba(242, 213, 153, 0.10);
  border-radius: 8px;
  border-left: 3px solid var(--gold);
}

.calc-info-benchmarks strong {
  color: var(--gold-dark);
  font-weight: 700;
}

/* ============================================================
   AGENT PANEL
   ============================================================ */

.agent-panel {
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  min-height: 480px;
  background: var(--white);
  border: 1px solid rgba(221, 214, 205, 0.5);
  border-radius: 18px;
  overflow: hidden;
  transition: border-color var(--duration-base), box-shadow var(--duration-base);
  position: relative;
}

.agent-panel:hover {
  border-color: rgba(242, 213, 153, 0.5);
  box-shadow: var(--shadow-lg);
}

.agent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--beige-medium);
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-mid), var(--gradient-end));
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.agent-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 80%);
}

.agent-header > * { position: relative; z-index: 1; }

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

.agent-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold) 0%, #f0cf8c 100%);
  color: var(--brand-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(242, 213, 153, 0.40), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  position: relative;
  animation: ringPulse 2.4s ease-out infinite;
}

.agent-title-line {
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 8px;
}

.agent-title-line::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  animation: ringPulse 2s ease-out infinite;
}

.agent-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 2px;
}

.agent-header .module-toggle {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.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: 14px;
  background:
    linear-gradient(180deg, rgba(244, 241, 238, 0.3) 0%, transparent 80px),
    var(--white);
}

.agent-messages::-webkit-scrollbar { width: 6px; }
.agent-messages::-webkit-scrollbar-track { background: transparent; }
.agent-messages::-webkit-scrollbar-thumb {
  background: var(--beige-dark);
  border-radius: 3px;
}

/* Note: app.js uses .message NOT .agent-message */
.message {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
  animation: waveIn 0.35s var(--ease-out);
}

.message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-light));
  color: var(--white);
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(34, 40, 120, 0.18);
}

.message.assistant {
  align-self: flex-start;
  background: var(--beige-light);
  color: var(--brand-blue);
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(221, 214, 205, 0.5);
}

.message.assistant strong {
  color: var(--gold-dark);
  font-weight: 700;
}

.message.assistant a {
  color: var(--brand-blue);
  font-weight: 600;
  border-bottom: 1px solid var(--gold);
}

.message.assistant ul,
.message.assistant ol {
  padding-left: 20px;
  margin: 6px 0;
}
.message.assistant li { margin: 2px 0; }

/* Legacy .agent-message (kept for compatibility if used elsewhere) */
.agent-message {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
}
.agent-message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-light));
  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;
}

.typing-indicator {
  align-self: flex-start;
  display: inline-flex;
  gap: 4px;
  padding: 14px 18px;
  background: var(--beige-light);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-blue-light);
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.30s; }

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

.agent-input {
  flex: 1;
  padding: 11px 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: 0;
  width: 44px;
  min-height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
}

/* ============================================================
   CTA BANNER
   ============================================================ */

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

.cta-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 25%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 25%, transparent 75%);
  z-index: 0;
}

/* Aurora glow on CTA */
.cta-banner::after {
  content: "";
  position: absolute;
  top: -100px;
  right: -120px;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(242, 213, 153, 0.25), transparent 65%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: aurora 24s ease-in-out infinite;
}

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

.cta-inner {
  position: relative;
  z-index: 1;
  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.6vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-bottom: 16px;
}

.cta-banner h2 .accent {
  background: linear-gradient(110deg, var(--gold) 0%, var(--gold-light) 25%, var(--gold) 50%, var(--gold-light) 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;
}

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

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

/* ============================================================
   FOOTER
   ============================================================ */

.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;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .text-shimmer-gold {
    animation: none;
    -webkit-text-fill-color: var(--gold);
  }
  .btn-shine::after { animation: none; }
}

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

.bg-flowie-gradient :focus-visible,
.page-header :focus-visible,
.cta-banner :focus-visible,
.footer :focus-visible,
.agent-header :focus-visible {
  outline-color: var(--gold);
}
