/* ============================================
   Blu Diamond Water - Water Footprint Calculator
   Brand Colors:
     Primary Dark Blue: #01118a
     Secondary Blue: #1863dc
     Accent Light Blue: #72cce9
     Accent Green: #c2d500
     White: #ffffff
     Light Gray: #f6f6f6
   ============================================ */

:root {
  --primary: #01118a;
  --secondary: #1863dc;
  --accent: #72cce9;
  --accent-green: #c2d500;
  --white: #ffffff;
  --gray-50: #f8f9fa;
  --gray-100: #f1f3f5;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-full: 50px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.15);
  --transition: all 0.25s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Century Gothic', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: var(--gray-800);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.hidden {
  display: none !important;
}

/* ============ HEADER ============ */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.95);
}

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

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

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

.footer-logo .logo-img {
  height: 24px;
  filter: brightness(0) invert(1);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-nav a {
  color: var(--gray-700);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.header-nav a:hover {
  color: var(--primary);
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  background: var(--primary);
  color: var(--white);
  font-family: inherit;
  line-height: 1.4;
}

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

.btn:active {
  transform: translateY(0);
}

.btn-sm {
  padding: 8px 20px;
  font-size: 0.85rem;
}

.btn-get-started {
  background: var(--secondary);
  color: #ffffff !important;
}

.btn-get-started:hover {
  background: var(--accent);
  color: var(--primary) !important;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.05rem;
}

.btn-full {
  width: 100%;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--gray-300);
}

.btn-outline:hover {
  border-color: var(--primary);
  background: transparent;
  color: var(--primary);
  box-shadow: none;
}

.btn-accent {
  background: var(--accent-green);
  color: var(--primary);
}

.btn-accent:hover {
  background: #d4e600;
}

/* ============ HERO ============ */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #0a1f6b 60%, var(--secondary) 100%);
  color: var(--white);
  padding: 80px 0 100px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(114,204,233,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(194,213,0,0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 720px;
  margin: 0 auto 60px;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}

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

.hero-subtitle {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 32px;
  line-height: 1.7;
  font-weight: 300;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  position: relative;
  z-index: 1;
}

.stat-card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  backdrop-filter: blur(8px);
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 8px;
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.5;
}

/* ============ CALCULATOR SECTION ============ */
.calculator-section {
  padding: 80px 0;
  background: transparent;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.section-header p {
  font-size: 1.05rem;
  color: var(--gray-600);
  max-width: 560px;
  margin: 0 auto;
}

.calculator-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px;
  max-width: 800px;
  margin: 0 auto;
}

/* Progress Bar */
.progress-bar {
  margin-bottom: 40px;
}

.progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}

.step-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  transition: var(--transition);
}

.progress-step.active .step-dot {
  background: var(--primary);
  color: var(--white);
}

.progress-step.completed .step-dot {
  background: var(--accent);
  color: var(--primary);
}

.step-label {
  font-size: 0.8rem;
  color: var(--gray-500);
  font-weight: 500;
}

.progress-step.active .step-label {
  color: var(--primary);
  font-weight: 600;
}

.progress-line {
  width: 80px;
  height: 3px;
  background: var(--gray-200);
  margin: 0 8px;
  margin-bottom: 24px;
  border-radius: 2px;
}

/* Step: Facility Selection */
.step h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 24px;
  text-align: center;
}

/* Region Mode Toggle (US / International) */
.mode-toggle-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.mode-btn {
  padding: 10px 28px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 2px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
}

.mode-btn:first-child {
  border-radius: var(--radius-full) 0 0 var(--radius-full);
  border-right: 1px solid var(--gray-200);
}

.mode-btn:last-child {
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  border-left: 1px solid var(--gray-200);
}

.mode-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.mode-btn:hover:not(.active) {
  border-color: var(--accent);
  color: var(--gray-800);
}

.mode-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 0.82rem;
  color: var(--gray-600);
  line-height: 1.5;
}

.mode-note svg {
  color: var(--secondary);
}

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

.facility-card {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: inherit;
}

.facility-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.facility-card.selected {
  border-color: var(--primary);
  background: rgba(1,17,138,0.03);
  box-shadow: 0 0 0 3px rgba(1,17,138,0.1);
}

.facility-icon {
  width: 48px;
  height: 48px;
  color: var(--secondary);
}

.facility-icon svg {
  width: 100%;
  height: 100%;
}

.facility-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
}

.facility-desc {
  font-size: 0.8rem;
  color: var(--gray-500);
}

/* Mode Toggle */
/* Step 2: Form Fields */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--gray-800);
  transition: var(--transition);
  background: var(--white);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(24,99,220,0.1);
}

.form-group input::placeholder {
  color: var(--gray-400);
}

.form-group .hint {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  gap: 12px;
}

/* ============ RESULTS ============ */
.results-container {
  animation: fadeIn 0.5s ease;
}

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

/* Unit Toggle */
.unit-toggle-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}

.unit-btn {
  padding: 8px 24px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 2px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.unit-btn:first-child {
  border-radius: var(--radius-full) 0 0 var(--radius-full);
  border-right: 1px solid var(--gray-200);
}

.unit-btn:last-child {
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  border-left: 1px solid var(--gray-200);
}

.unit-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* Result Total */
.result-total {
  text-align: center;
  padding: 32px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-lg);
  color: var(--white);
  margin-bottom: 32px;
}

.result-total-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.8;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.result-total-number {
  display: block;
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.result-total-unit {
  display: block;
  font-size: 1rem;
  opacity: 0.7;
  margin-top: 4px;
}

/* Breakdown */
.result-breakdown {
  margin-bottom: 32px;
}

.result-breakdown h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
}

.breakdown-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.breakdown-label {
  width: 140px;
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-700);
}

.breakdown-bar-wrap {
  flex: 1;
  height: 28px;
  background: var(--gray-100);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
}

.breakdown-bar {
  height: 100%;
  border-radius: 14px;
  transition: width 0.8s ease;
  min-width: 2px;
}

.breakdown-value {
  width: 120px;
  flex-shrink: 0;
  text-align: right;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray-800);
}

/* Scope-based bar colors */
.bar-scope1 { background: var(--primary); }
.bar-scope2 { background: var(--secondary); }
.bar-scope3 { background: var(--accent-green); }
.bar-color-0 { background: var(--primary); }
.bar-color-1 { background: var(--secondary); }
.bar-color-2 { background: var(--accent); }
.bar-color-3 { background: var(--accent-green); }
.bar-color-4 { background: #f59e0b; }

/* Scope tags on breakdown labels */
.breakdown-scope-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.03em;
}
.scope-tag-scope1 { background: rgba(1,17,138,0.1); color: var(--primary); }
.scope-tag-scope2 { background: rgba(24,99,220,0.1); color: var(--secondary); }
.scope-tag-scope3 { background: rgba(194,213,0,0.15); color: #6b8e00; }

/* Context Cards */
.context-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.context-card {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.context-card-number {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 4px;
}

.context-card-label {
  font-size: 0.8rem;
  color: var(--gray-600);
  line-height: 1.4;
}

/* Offset CTA */
.offset-cta {
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f4f8 100%);
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 32px;
}

.offset-cta h4 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.offset-cta p {
  font-size: 0.9rem;
  color: var(--gray-600);
  margin-bottom: 20px;
  line-height: 1.6;
}

.offset-stat {
  text-align: center;
  padding: 20px;
  background: var(--white);
  border-radius: var(--radius);
}

.offset-stat-number {
  display: block;
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.offset-stat-label {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-top: 4px;
  display: block;
}

/* Scope Selection Checkboxes */
.scope-select {
  text-align: center;
  margin: 16px 0 8px;
}
.scope-select-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 10px;
}
.scope-checkboxes {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.scope-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  user-select: none;
}
.scope-checkbox input[type="checkbox"] {
  display: none;
}
.scope-checkbox-mark {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid var(--gray-300);
  position: relative;
  transition: all 0.15s ease;
}
.scope-checkbox input:checked + .scope-checkbox-s1 {
  background: var(--primary);
  border-color: var(--primary);
}
.scope-checkbox input:checked + .scope-checkbox-s2 {
  background: var(--secondary);
  border-color: var(--secondary);
}
.scope-checkbox input:checked + .scope-checkbox-mark::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 6px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Lead Form */
.lead-form-section {
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
}

.lead-form-section h4 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.lead-form-section > p {
  font-size: 0.9rem;
  color: var(--gray-600);
  margin-bottom: 24px;
}

.lead-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.lead-success {
  text-align: center;
  padding: 24px;
}

.success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
}

.success-icon svg {
  width: 100%;
  height: 100%;
}

.lead-success h4 {
  color: var(--success);
  margin-bottom: 8px;
}

/* ============ HOW IT WORKS ============ */
.how-it-works {
  padding: 80px 0;
  background: transparent;
}

.hiw-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 800px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px;
}

.hiw-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 24px 28px;
  background: var(--gray-50);
  border-radius: var(--radius);
  transition: var(--transition);
}

.hiw-row:hover {
  background: var(--gray-100);
}

.hiw-number {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--primary);
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.hiw-content {
  flex: 1;
}

.hiw-content h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.hiw-content p {
  font-size: 0.9rem;
  color: var(--gray-600);
  line-height: 1.6;
}

/* ============ FOOTER ============ */
.footer {
  background: var(--primary);
  color: rgba(255,255,255,0.7);
  padding: 48px 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
}

.footer-tagline {
  font-size: 0.9rem;
  margin-top: 12px;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 8px;
}

.footer-links a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-legal {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  font-size: 0.8rem;
}

.disclaimer {
  margin-top: 8px;
  font-size: 0.75rem;
  opacity: 0.6;
}

/* ============ SCOPE SUMMARY CARDS ============ */
.scope-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.scope-card {
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  position: relative;
}

.scope-card--scope1 {
  background: rgba(1,17,138,0.04);
  border: 2px solid var(--primary);
}

.scope-card--scope2 {
  background: rgba(24,99,220,0.04);
  border: 2px solid var(--secondary);
}

.scope-card--scope3 {
  background: rgba(194,213,0,0.04);
  border: 2px dashed var(--gray-300);
}

.scope-card--coming-soon {
  opacity: 0.75;
}

.scope-card--coming-soon .scope-card-label {
  color: var(--gray-500) !important;
}

.scope-card-coming-soon-label {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-green);
  margin: 8px 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.scope-card-coming-soon-text {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-500);
  line-height: 1.4;
}

.scope-card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 4px;
}

.scope-card-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.scope-card--scope1 .scope-card-label { color: var(--primary); }
.scope-card--scope2 .scope-card-label { color: var(--secondary); }
.scope-card--scope3 .scope-card-label { color: #6b8e00; }

.scope-card-subtitle {
  display: block;
  font-size: 0.78rem;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.scope-card-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gray-800);
  line-height: 1.2;
}

.scope-card-unit {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 2px;
}

.scope-card-pct {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 4px;
}


/* ============ TOOLTIPS ============ */
.tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--gray-400);
  cursor: help;
  position: relative;
  outline: none;
  flex-shrink: 0;
}

.tooltip-trigger:hover,
.tooltip-trigger:focus {
  color: var(--secondary);
}

.tooltip-content {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-800);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 8px;
  width: 260px;
  z-index: 10;
  box-shadow: var(--shadow-lg);
  text-transform: none;
  letter-spacing: 0;
  text-align: left;
}

.tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--gray-800);
}

.tooltip-trigger:hover .tooltip-content,
.tooltip-trigger:focus .tooltip-content {
  display: block;
}

/* ============ WATERSHED CARD ============ */
.watershed-card {
  background: linear-gradient(135deg, #f0f7ff 0%, #eef8f3 100%);
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 28px;
}

.watershed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.watershed-header h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

.watershed-huc {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-500);
  background: var(--white);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--gray-200);
}

.watershed-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 16px;
}

.watershed-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.watershed-item {
  background: var(--white);
  border-radius: 8px;
  padding: 12px 14px;
}

.watershed-item-full {
  grid-column: 1 / -1;
}

.watershed-item-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  margin-bottom: 4px;
}

.watershed-item-value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-800);
}

.water-stress-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.watershed-source {
  margin-top: 12px;
  font-size: 0.72rem;
  color: var(--gray-500);
  font-style: italic;
}

.watershed-loading {
  text-align: center;
  padding: 20px;
  color: var(--gray-500);
  font-size: 0.88rem;
  font-style: italic;
}


/* ============ EMBED MODE ============ */
/* Hide header, hero, and footer when loaded via ?embed=true */
html.embed-mode .header,
html.embed-mode .hero,
html.embed-mode .footer {
  display: none !important;
}

html.embed-mode body {
  background: transparent;
}

html.embed-mode .calculator-section {
  padding-top: 0;
}

html.embed-mode .section-header {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: var(--radius-lg);
  padding: 32px 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

html.embed-mode .section-header h2 {
  color: var(--white);
}

html.embed-mode .section-header p {
  color: rgba(255, 255, 255, 0.9);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .header-nav {
    gap: 12px;
  }

  .header-nav a:not(.btn) {
    font-size: 0.8rem;
  }

  .btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
  }

  .logo-img {
    height: 22px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .calculator-card {
    padding: 24px;
  }

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

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

  .context-cards {
    grid-template-columns: 1fr;
  }

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

  .scope-summary {
    grid-template-columns: 1fr;
  }

  .scope-card-value {
    font-size: 1.2rem;
  }

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

  .tooltip-content {
    width: 200px;
    left: auto;
    right: -10px;
    transform: none;
  }

  .tooltip-content::after {
    left: auto;
    right: 14px;
  }

  .hiw-row {
    padding: 20px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .result-total-number {
    font-size: 2rem;
  }

  .progress-steps {
    gap: 0;
  }

  .progress-line {
    width: 40px;
  }

  .step-label {
    font-size: 0.7rem;
  }

  .breakdown-label {
    width: 100px;
    font-size: 0.78rem;
  }

  .breakdown-value {
    width: 90px;
    font-size: 0.78rem;
  }
}

@media (max-width: 480px) {
  .header-nav a:not(.btn) {
    display: none;
  }

  .hero {
    padding: 48px 0 64px;
  }

  .hero h1 {
    font-size: 1.7rem;
  }

  .calculator-section {
    padding: 48px 0;
  }

  .section-header h2 {
    font-size: 1.5rem;
  }

  .hiw-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 16px;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions .btn {
    width: 100%;
  }
}


/* ================================================================
   BATCH UPLOAD STYLES
   ================================================================ */

/* Input Mode Toggle */
.input-mode-toggle-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.input-mode-btn {
  padding: 8px 22px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 2px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
}

.input-mode-btn:first-child {
  border-radius: var(--radius-full) 0 0 var(--radius-full);
  border-right: 1px solid var(--gray-200);
}

.input-mode-btn:last-child {
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  border-left: 1px solid var(--gray-200);
}

.input-mode-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.input-mode-btn:hover:not(.active) {
  border-color: var(--accent);
  color: var(--gray-800);
}

/* Batch Upload Area */
.batch-subtitle {
  text-align: center;
  color: var(--gray-500);
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.upload-dropzone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}

.upload-dropzone.drag-over {
  border-color: var(--primary);
  background: rgba(23, 37, 84, 0.03);
}

.upload-dropzone:hover {
  border-color: var(--secondary);
}

.upload-icon {
  color: var(--gray-400);
  margin-bottom: 12px;
}

.upload-text {
  color: var(--gray-600);
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.upload-browse {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.upload-browse:hover {
  color: var(--secondary);
}

.upload-hint {
  color: var(--gray-400);
  font-size: 0.8rem;
}

.upload-file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.file-info-details {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-700);
  font-size: 0.9rem;
}

.upload-row-badge {
  background: var(--primary);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.batch-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  margin-bottom: 20px;
}

/* Batch Preview Table */
.batch-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}

.batch-preview-status {
  font-size: 0.9rem;
  color: var(--gray-600);
  font-weight: 500;
}

.batch-error-count {
  color: #ef4444;
  font-weight: 600;
}

.batch-preview-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}

.batch-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.batch-preview-table th {
  background: var(--gray-50);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--gray-700);
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
}

.batch-preview-table td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}

.batch-row-error {
  background: #fef2f2;
}

.batch-row-valid:nth-child(even) {
  background: var(--gray-50);
}

.batch-error-badge {
  display: inline-block;
  background: #fecaca;
  color: #991b1b;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  cursor: help;
}

.batch-valid-badge {
  display: inline-block;
  background: #dcfce7;
  color: #166534;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Batch Results */
.batch-summary-stats {
  text-align: center;
  padding: 8px 0 16px;
  color: var(--gray-500);
  font-size: 0.9rem;
}

.batch-actions-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

/* Comparison Table */
.batch-comparison-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 30px;
}

.batch-comparison-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.batch-comparison-tbl th {
  background: var(--gray-50);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--gray-700);
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
}

.batch-comparison-tbl th.sortable {
  cursor: pointer;
  user-select: none;
}

.batch-comparison-tbl th.sortable:hover {
  color: var(--primary);
}

.batch-comparison-tbl td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}

.batch-comparison-tbl tbody tr:nth-child(even) {
  background: var(--gray-50);
}

.batch-comparison-tbl tbody tr:hover {
  background: rgba(23, 37, 84, 0.03);
}

/* Facility Type Bars */
.batch-type-bars {
  margin-bottom: 30px;
}

.batch-type-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.batch-type-label {
  flex: 0 0 180px;
  font-size: 0.85rem;
  color: var(--gray-700);
  text-align: right;
}

.batch-type-label small {
  color: var(--gray-400);
}

.batch-type-bar-track {
  flex: 1;
  height: 20px;
  background: var(--gray-100);
  border-radius: var(--radius);
  overflow: hidden;
}

.batch-type-bar-fill {
  height: 100%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius);
  transition: width 0.6s ease;
}

.batch-type-value {
  flex: 0 0 80px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
}

/* Responsive */
@media (max-width: 640px) {
  .batch-type-label {
    flex: 0 0 120px;
    font-size: 0.8rem;
  }
  .batch-type-value {
    flex: 0 0 60px;
    font-size: 0.8rem;
  }
  .input-mode-btn {
    padding: 7px 16px;
    font-size: 0.8rem;
  }
}

/* ============================================================
   LOCATION PREVIEW (live card under ZIP input)
   ============================================================ */
.location-preview {
  margin-top: 10px;
  padding: 12px 16px;
  background: var(--gray-50);
  border-left: 3px solid var(--secondary);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--gray-700);
}
.location-preview.error {
  border-left-color: var(--danger);
  background: rgba(239, 68, 68, 0.06);
  color: var(--danger);
}
.location-preview-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 4px 0;
}
.location-preview-label {
  flex: 0 0 88px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
}
.location-preview-value {
  flex: 1;
  color: var(--gray-800);
  font-weight: 500;
}
.location-preview-loading,
.location-preview-loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-500);
  font-style: italic;
}
.location-preview-error {
  font-weight: 600;
}
.spinner-sm {
  width: 14px;
  height: 14px;
  border: 2px solid var(--gray-300);
  border-top-color: var(--secondary);
  border-radius: 50%;
  animation: bdw-spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes bdw-spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   MAP CONTAINERS (Leaflet)
   ============================================================ */
#location-map-section {
  margin-bottom: 32px;
}
#location-map-section h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}
.map-container {
  height: 360px;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  margin-bottom: 6px;
  background: var(--gray-50);
}
.map-attribution {
  text-align: right;
  font-size: 0.72rem;
  color: var(--gray-500);
  margin-top: 0;
}
.map-attribution a {
  color: var(--gray-500);
}

/* ============================================================
   SCENARIO PLANNING
   (adapted from water-risk-calculator/styles.css)
   ============================================================ */
.scenario-panel {
  background: var(--white);
  border: 2px solid var(--secondary);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 32px;
}
.scenario-panel h4 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}
.scenario-description {
  font-size: 0.9rem;
  color: var(--gray-600);
  margin-bottom: 20px;
}
.scenario-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.scenario-preset-btn {
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 2px solid var(--gray-200);
  background: var(--white);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  color: var(--gray-700);
}
.scenario-preset-btn:hover {
  border-color: var(--secondary);
  color: var(--secondary);
  background: rgba(24, 99, 220, 0.04);
}
.scenario-preset-btn.active {
  border-color: var(--secondary);
  background: var(--secondary);
  color: var(--white);
}
.scenario-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
  padding: 20px;
  background: var(--gray-50);
  border-radius: var(--radius);
}
.scenario-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.scenario-input-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-700);
}
.scenario-input-group input,
.scenario-input-group select {
  padding: 8px 12px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--gray-800);
  background: var(--white);
}
.scenario-location-preview {
  margin-top: 6px;
}
.scenario-actions {
  display: flex;
  gap: 12px;
}

/* Scenario comparison */
.scenario-comparison {
  margin-top: 24px;
  padding: 24px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: var(--white);
}
.scenario-comparison h4 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}
.scenario-changes {
  font-size: 0.88rem;
  color: var(--gray-700);
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--gray-50);
  border-radius: var(--radius);
}
.scenario-overall {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px;
  margin-bottom: 24px;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
}
.scenario-overall-baseline,
.scenario-overall-projected {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.scenario-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
}
.scenario-score {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
}
.scenario-level {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-600);
}
.scenario-overall-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.scenario-arrow {
  font-size: 2rem;
  color: var(--gray-400);
}
.scenario-overall-arrow.worse .scenario-arrow { color: var(--danger); }
.scenario-overall-arrow.better .scenario-arrow { color: var(--success); }
.scenario-overall-arrow .scenario-delta {
  font-size: 0.95rem;
  font-weight: 700;
}
.scenario-overall-arrow.worse .scenario-delta { color: var(--danger); }
.scenario-overall-arrow.better .scenario-delta { color: var(--success); }
.scenario-overall-arrow.neutral .scenario-delta { color: var(--gray-500); }

.scenario-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 0.88rem;
}
.scenario-table thead {
  background: var(--primary);
  color: var(--white);
}
.scenario-table th {
  padding: 10px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
}
.scenario-table th:first-child {
  text-align: left;
}
.scenario-table td {
  padding: 10px 14px;
  text-align: center;
  border-bottom: 1px solid var(--gray-100);
}
.scenario-table-name {
  font-weight: 600;
  color: var(--gray-700);
  text-align: left !important;
}
.scenario-cell-score {
  font-weight: 700;
  display: inline-block;
  min-width: 32px;
}
.scenario-delta-cell {
  font-weight: 700;
  font-size: 0.85rem;
}
.scenario-delta-cell.worse   { color: var(--danger); }
.scenario-delta-cell.better  { color: var(--success); }
.scenario-delta-cell.neutral { color: var(--gray-500); }

.scenario-maps {
  display: flex;
  gap: 16px;
  margin: 20px 0 8px;
}
.scenario-map-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.scenario-map-caption {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-700);
}
.scenario-map-col .map-container {
  height: 280px;
}

.scenario-insights {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.scenario-insight {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  line-height: 1.5;
}
.scenario-insight.worse {
  background: rgba(239, 68, 68, 0.08);
  border-left: 4px solid var(--danger);
  color: var(--gray-700);
}
.scenario-insight.better {
  background: rgba(34, 197, 94, 0.08);
  border-left: 4px solid var(--success);
  color: var(--gray-700);
}
.scenario-insight.neutral {
  background: var(--gray-50);
  border-left: 4px solid var(--gray-300);
  color: var(--gray-600);
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .scenario-panel {
    padding: 20px;
  }
  .scenario-inputs {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .scenario-overall {
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }
  .scenario-maps {
    flex-direction: column;
  }
  .scenario-map-col .map-container {
    height: 220px;
  }
  .map-container {
    height: 260px;
  }
}
