/* ============================================
   FHE Enterprise Systems TCO Calculator
   Design: Dark navy + cyan accents (Service Catalogue aesthetic)
   Fonts: Inter (body), Cardo (display), JetBrains Mono (labels)
   ============================================ */

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

/* Design Tokens */
:root {
  /* FHE Brand Colors */
  --fhe-purple: #7a00df;
  --fhe-blue: #007cba;
  --fhe-green: #00d084;
  --fhe-amber: #c97c00;
  --fhe-red: #c4302b;

  /* Dark Navy Enterprise Palette */
  --navy-darkest: #0a0e17;
  --navy-dark: #0f1524;
  --navy: #15203a;
  --navy-light: #1e2d4a;
  --navy-lighter: #283858;

  /* Cyan Accent System */
  --cyan: #00d4ff;
  --cyan-bright: #5fe7ff;
  --cyan-dim: #0099b8;
  --cyan-deep: #007a99;

  /* Pillar Colors (muted for dark bg) */
  --pillar1: #00d4ff;
  --pillar1-dim: #007a99;
  --pillar2: #5fe7ff;
  --pillar2-dim: #2a9bb8;
  --pillar3: #eb551e;
  --pillar3-dim: #b03e14;
  --pillar4: #ff6b9d;
  --pillar4-dim: #b8305f;

  /* Text */
  --text-primary: #e8edf5;
  --text-secondary: #a0b0c8;
  --text-muted: #6b7a92;

  /* Surfaces */
  --surface: #0f1524;
  --surface-raised: #15203a;
  --surface-overlay: #1e2d4a;
  --surface-hover: #233458;

  /* Borders */
  --border: #283858;
  --border-light: #1e2d4a;

  /* System Colors */
  --color-sjms5: #00d4ff;
  --color-sits: #ff6b6b;
  --color-banner: #eb551e;
  --color-workday: #c084fc;
  --color-technologyone: #5fe7ff;
  --color-custom: #00d084;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
  --shadow-cyan: 0 0 24px rgba(0, 212, 255, 0.15);

  /* Transitions */
  --transition: 200ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Cardo', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
}

/* Dark mode (default) */
[data-theme="dark"] {
  --bg: var(--navy-darkest);
  --bg-gradient: linear-gradient(180deg, #0a0e17 0%, #0f1524 100%);
  --text: var(--text-primary);
  --text-secondary: var(--text-secondary);
  --text-muted: var(--text-muted);
}

/* Light mode */
[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-gradient: linear-gradient(180deg, #eef2f8 0%, #f4f6fb 100%);
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-overlay: #f8fafc;
  --surface-hover: #f0f4fa;
  --border: #d1d9e6;
  --border-light: #e3e8f0;
  --text: #1a2332;
  --text-secondary: #4a5a72;
  --text-muted: #8a9bb5;
  --shadow-sm: 0 1px 3px rgba(15,30,50,0.06);
  --shadow-md: 0 4px 16px rgba(15,30,50,0.08);
  --shadow-lg: 0 12px 40px rgba(15,30,50,0.12);
  --shadow-cyan: 0 0 24px rgba(0, 153, 184, 0.1);
  --navy: #1a2332;
  --navy-light: #2a3a52;
}

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

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Embed mode - hide header/footer */
body.embed-mode .header,
body.embed-mode .footer {
  display: none !important;
}

body.embed-mode {
  padding: 0;
}

body.embed-mode .hero {
  padding-top: 2rem;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy-darkest);
  border-bottom: 1px solid var(--border-light);
  backdrop-filter: blur(12px);
}

[data-theme="light"] .header {
  background: #ffffff;
  border-bottom: 1px solid #d1d9e6;
  backdrop-filter: none;
  box-shadow: 0 1px 3px rgba(15,30,50,0.06);
}

[data-theme="light"] .logo-img {
  filter: brightness(0); /* Make white logo visible on light background */
  opacity: 0.85;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--text);
}

.logo-img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo .brand {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.logo .product {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--cyan);
}

.header-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.header-link:hover {
  color: var(--cyan);
}

/* Theme toggle */
.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-overlay);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.theme-toggle:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}

/* Section label */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cyan);
  margin-bottom: 0.75rem;
}

/* Hero */
.hero {
  background: var(--bg-gradient);
  padding: 3rem 0 2.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  background: var(--surface-overlay);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--cyan);
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  max-width: 800px;
  margin: 0 auto 1rem;
}

.accent-text {
  color: var(--cyan);
}

.hero p {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto 1.5rem;
}

/* Proof Pills */
.proof-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.proof-pill {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  background: var(--surface-overlay);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--cyan-bright);
  white-space: nowrap;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--cyan);
  color: var(--navy-darkest);
}

.btn-primary:hover {
  background: var(--cyan-bright);
  box-shadow: var(--shadow-cyan);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* FHE Suite Section */
.suite-section {
  background: var(--surface);
  padding: 3rem 0;
  border-bottom: 1px solid var(--border-light);
}

.suite-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.suite-sub {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 640px;
}

.suite-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.suite-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--transition);
}

.suite-card:hover {
  border-color: var(--cyan-dim);
  box-shadow: var(--shadow-md);
}

.suite-card.featured {
  border-color: var(--cyan);
  box-shadow: var(--shadow-cyan);
}

.suite-tag {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.suite-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 0.25rem;
}

.suite-full {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.suite-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 0.75rem;
}

.suite-metrics {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

/* Main Calculator */
.main {
  padding: 2.5rem 0 4rem;
}

.calculator-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 2rem;
  align-items: start;
}

/* Config Panel */
.config-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
}

.config-panel h2 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.config-panel .subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.input-group {
  margin-bottom: 1.25rem;
}

.input-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.375rem;
}

.range-value {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.375rem;
}

.range-value label {
  margin-bottom: 0;
}

.value-display {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--cyan);
}

input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--surface-overlay);
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--cyan);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--navy-darkest);
  box-shadow: 0 0 0 1px var(--cyan);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--cyan);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--navy-darkest);
}

select,
input[type="number"],
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: var(--font-body);
  background: var(--surface-overlay);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: all var(--transition);
}

select:focus,
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.12);
}

.input-hint {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* System Options */
.system-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.system-option {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface-overlay);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
}

.system-option.active {
  background: var(--cyan);
  color: var(--navy-darkest);
  border-color: var(--cyan);
}

.system-option:hover:not(.active) {
  border-color: var(--cyan-dim);
  color: var(--cyan);
}

/* Custom Cost Toggle */
.custom-cost-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

.custom-cost-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface-overlay);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: var(--transition);
}

.switch-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: var(--transition);
}

.switch input:checked + .switch-slider {
  background: var(--cyan);
  border-color: var(--cyan);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(20px);
  background: var(--navy-darkest);
}

.switch-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

/* Custom Cost Inputs */
.custom-cost-inputs {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.custom-cost-header {
  margin-bottom: 1rem;
}

.custom-name-input {
  font-weight: 600;
}

.custom-pillar-group {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--surface-overlay);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border);
}

.custom-pillar-group:nth-child(2) { border-left-color: var(--pillar1); }
.custom-pillar-group:nth-child(3) { border-left-color: var(--pillar2); }
.custom-pillar-group:nth-child(4) { border-left-color: var(--pillar3); }
.custom-pillar-group:nth-child(5) { border-left-color: var(--pillar4); }

.custom-pillar-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.pillar-1-color { color: var(--pillar1); }
.pillar-2-color { color: var(--pillar2); }
.pillar-3-color { color: var(--pillar3); }
.pillar-4-color { color: var(--pillar4); }

.custom-cost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
}

.custom-cost-row label {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 0;
  flex: 1;
}

.cost-input {
  width: 100px !important;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  text-align: right;
}

/* Results */
.results {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

/* Savings Card */
.savings-card {
  background: #0f172a;
  border: 1px solid var(--cyan-dim);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-cyan);
}

/* Light mode: savings card uses dark navy #0f172a */
[data-theme="light"] .savings-card {
  background: #0f172a;
  border-color: #1e3a5f;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .savings-card .label {
  color: #a0b0c8;
}

[data-theme="light"] .savings-card .period {
  color: #8a9bb5;
}

/* Light mode: make outline button visible on dark savings card */
[data-theme="light"] .savings-card .btn-outline {
  background: rgba(255, 255, 255, 0.08);
  color: #e8edf5;
  border-color: #3a4868;
}

[data-theme="light"] .savings-card .btn-outline:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(255, 255, 255, 0.12);
}

/* Dark mode: ensure outline button text is readable on dark savings card */
[data-theme="dark"] .savings-card .btn-outline {
  color: #c8d4e4;
  border-color: #3a4868;
}

[data-theme="dark"] .savings-card .btn-outline:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}

.savings-card .label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.savings-card .amount {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--cyan);
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.savings-card .period {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.savings-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

/* KPI Row */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.kpi.accent {
  border-color: var(--cyan-dim);
}

.kpi.success {
  border-color: rgba(0, 208, 132, 0.3);
}

.kpi-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.kpi.accent .kpi-value {
  color: var(--cyan);
}

.kpi.success .kpi-value {
  color: var(--fhe-green);
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.card-header {
  margin-bottom: 1.25rem;
}

.card-header h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
}

.card-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Wrapper Card (Managed Wrapper explainer) */
.wrapper-card {
  border-color: var(--cyan-dim);
}

.wrapper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.wrapper-item {
  padding: 1rem;
  background: var(--surface-overlay);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.wrapper-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.wrapper-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--cyan);
  margin-bottom: 0.375rem;
}

.wrapper-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Pillar Summary */
.pillar-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.pillar-item {
  padding: 1rem;
  background: var(--surface-overlay);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--border);
}

.pillar-item.pillar-1 { border-left-color: var(--pillar1); }
.pillar-item.pillar-2 { border-left-color: var(--pillar2); }
.pillar-item.pillar-3 { border-left-color: var(--pillar3); }
.pillar-item.pillar-4 { border-left-color: var(--pillar4); }

.pillar-name {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}

.pillar-bar {
  position: relative;
  height: 8px;
  background: var(--surface-raised);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.pillar-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.pillar-values {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

.pillar-value-sjms5 {
  color: var(--cyan);
  font-weight: 600;
}

.pillar-value-other {
  color: var(--text-muted);
}

/* Charts */
.chart-container {
  position: relative;
  height: 320px;
  width: 100%;
}

.chart-container.small {
  height: 240px;
}

/* Cost Table */
.cost-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.cost-table th,
.cost-table td {
  padding: 0.625rem 0.75rem;
  text-align: right;
  border-bottom: 1px solid var(--border-light);
}

.cost-table th:first-child,
.cost-table td:first-child {
  text-align: left;
}

.cost-table th:nth-child(2),
.cost-table td:nth-child(2) {
  text-align: center;
}

.cost-table thead th {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface-overlay);
  position: sticky;
  top: 0;
  z-index: 1;
}

.cost-table tbody tr:hover {
  background: var(--surface-hover);
}

.cost-table .pillar-row td {
  font-weight: 600;
  background: var(--surface-overlay);
  color: var(--text);
}

.cost-type {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.cost-cell-sjms5 {
  color: var(--cyan);
  font-weight: 600;
}

.badge-sjms5 {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  background: rgba(0, 212, 255, 0.15);
  color: var(--cyan);
}

.badge-saving {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  background: rgba(0, 208, 132, 0.15);
  color: var(--fhe-green);
}

/* Legend */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* Competitive Landscape */
.landscape-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.landscape-item {
  padding: 1.25rem;
  background: var(--surface-overlay);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.landscape-cat {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cyan);
  margin-bottom: 0.375rem;
}

.landscape-names {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.landscape-item p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Honesty Card */
.honesty-card {
  border-color: var(--cyan-dim);
}

.honesty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.honesty-item {
  padding: 1rem;
  background: var(--surface-overlay);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.honesty-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--cyan);
  margin-bottom: 0.375rem;
}

.honesty-item p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Methodology */
.methodology {
  cursor: pointer;
}

.methodology summary {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-left: 1.5rem;
}

.methodology summary::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--cyan);
  transition: transform var(--transition);
}

.methodology[open] summary::before {
  transform: rotate(90deg);
}

.methodology summary::-webkit-details-marker {
  display: none;
}

.methodology-content {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.methodology-content p,
.methodology-content ul {
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.methodology-content ul {
  padding-left: 1.25rem;
}

.methodology-content li {
  margin-bottom: 0.25rem;
}

.methodology-content strong {
  color: var(--text);
}

.methodology-content h4 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--cyan);
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.methodology-content h4:first-child {
  margin-top: 0;
}

.methodology-content a {
  color: var(--cyan);
  text-decoration: none;
}

.methodology-content a:hover {
  text-decoration: underline;
}

/* Hosting & Tool Cost Card */
.hosting-card {
  border-color: var(--cyan-dim);
}

.hosting-content p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.hosting-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.hosting-item {
  background: var(--surface-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.875rem;
  text-align: center;
}

[data-theme="light"] .hosting-item {
  background: #f0f2f7;
  border-color: #d1d9e6;
}

.hosting-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}

.hosting-value {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 0.25rem;
}

.hosting-detail {
  font-size: 0.6875rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.hosting-link {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--cyan);
  text-decoration: none;
  margin-top: 0.375rem;
  word-break: break-all;
}

.hosting-link:hover {
  text-decoration: underline;
}

.hosting-note {
  font-size: 0.75rem !important;
  color: var(--text-muted) !important;
  line-height: 1.5;
}

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

/* Consultation Form */
.consultation-card {
  border-color: var(--cyan-dim);
}

/* Email Gate */
.gated-results {
  position: relative;
}

.gated-results.gate-open {
  /* No overlay when gate is open */
}

.gate-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  border-radius: var(--radius-lg);
  min-height: 400px;
  padding-top: 3rem;
}

.gated-results.gate-open .gate-overlay {
  display: none;
}

.gate-content {
  text-align: center;
  max-width: 400px;
  padding: 2rem;
}

.gate-content svg {
  color: var(--cyan-dim);
  margin-bottom: 1rem;
}

.gate-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.gate-content p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

[data-theme="light"] .gate-overlay {
  background: #ffffff;
}

[data-theme="light"] .gate-content svg {
  color: #0099b8;
}

/* How It Works Link */
.how-it-works-link {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.how-it-works-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--cyan-deep);
  text-decoration: none;
  border: 1px solid var(--cyan-dim);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: all var(--transition);
  cursor: pointer;
}

.how-it-works-btn:hover {
  background: var(--surface-hover);
  border-color: var(--cyan);
  color: var(--cyan);
}

[data-theme="light"] .how-it-works-btn {
  color: #006a8a;
  border-color: #b0d8e4;
  background: #f8fbfc;
}

[data-theme="light"] .how-it-works-btn:hover {
  background: #e8f4f8;
  border-color: #0099b8;
  color: #006a8a;
}

.form-intro {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.55;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

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

.form-field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.375rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
}

.form-field textarea {
  resize: vertical;
  font-family: var(--font-body);
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.form-note {
  font-size: 0.8125rem;
  color: var(--fhe-green);
  margin-top: 0.75rem;
  min-height: 1.2em;
}

.form-note.error {
  color: var(--fhe-red);
}

.form-note.success {
  color: var(--fhe-green);
  font-weight: 600;
}

/* Footer */
.footer {
  background: #0f172a;
  border-top: 1px solid var(--border-light);
  padding: 2rem 0;
}

[data-theme="light"] .footer {
  background: #0f172a;
  border-top: 1px solid #1e3a5f;
}

[data-theme="light"] .footer p,
[data-theme="light"] .footer .disclaimer,
[data-theme="light"] .footer .company-details {
  color: #a0b0c8;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.footer .disclaimer {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  max-width: 600px;
}

.footer .company-details {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
}

/* Responsive */
@media (max-width: 968px) {
  .calculator-grid {
    grid-template-columns: 1fr;
  }

  .config-panel {
    position: static;
    max-height: none;
  }

  .kpi-row {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .suite-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 2rem 0 1.5rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    justify-content: center;
  }

  .header-links .header-link {
    display: none;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 1rem;
  }

  .cost-table {
    font-size: 0.75rem;
  }

  .cost-table th,
  .cost-table td {
    padding: 0.5rem 0.375rem;
  }

  .wrapper-grid {
    grid-template-columns: 1fr;
  }

  /* Savings card — stack buttons, allow text wrapping */
  .savings-card {
    padding: 1.25rem 1rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  .savings-card .label {
    font-size: 0.6875rem;
    letter-spacing: 0.03em;
  }

  .savings-card .amount {
    font-size: clamp(1.5rem, 8vw, 2.5rem);
    word-break: break-all;
    overflow-wrap: break-word;
  }

  .savings-card .period {
    font-size: 0.6875rem;
    line-height: 1.4;
    overflow-wrap: break-word;
  }

  .savings-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .savings-actions .btn {
    justify-content: center;
    white-space: nowrap;
  }

  /* System options — wrap to multiple lines */
  .system-options {
    flex-wrap: wrap;
  }

  .system-option {
    flex: 1 1 auto;
    min-width: calc(50% - 0.375rem);
    text-align: center;
  }

  /* Pillar summary — single column */
  .pillar-summary {
    grid-template-columns: 1fr;
  }

  /* Charts — smaller height, allow scroll */
  .chart-container {
    height: 260px;
  }

  .chart-container.small {
    height: 200px;
  }

  /* Cards — reduce padding */
  .card {
    padding: 1rem;
  }

  /* KPI values — smaller font */
  .kpi-value {
    font-size: 1rem;
  }

  /* Header — hide nav links, keep logo + toggle */
  .header-inner {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .logo-text .brand {
    font-size: 0.75rem;
  }

  .logo-text .product {
    font-size: 0.625rem;
  }

  /* Config panel inputs */
  .config-panel {
    padding: 1rem;
  }

  /* Footer */
  .footer-inner {
    flex-direction: column;
    gap: 0.75rem;
  }

  .footer .disclaimer {
    font-size: 0.625rem;
  }
}
