/* ==========================================================================
   B2B PPC & Paid Search Waste Calculator - hunabkuh.com
   Design System & Styling: Modern B2B Tech Dark Mode + Glassmorphism
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  /* Color Palette */
  --bg-dark: #070a12;
  --bg-gradient: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #070a12 70%);
  --card-bg: rgba(15, 23, 42, 0.65);
  --card-bg-hover: rgba(30, 41, 59, 0.75);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-focus: rgba(99, 102, 241, 0.5);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #6366f1; /* Violet / Indigo */
  --accent-primary-hover: #4f46e5;
  --accent-primary-glow: rgba(99, 102, 241, 0.25);

  --accent-danger: #f43f5e; /* Rose / Coral Waste Alert */
  --accent-danger-bg: rgba(244, 63, 94, 0.1);
  --accent-danger-border: rgba(244, 63, 94, 0.3);
  --accent-danger-glow: rgba(244, 63, 94, 0.2);

  --accent-success: #10b981; /* Emerald Pipeline Opportunity */
  --accent-success-bg: rgba(16, 185, 129, 0.1);
  --accent-success-border: rgba(16, 185, 129, 0.3);

  --accent-warning: #f59e0b; /* Amber */

  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  padding: 2rem 1rem;
  -webkit-font-smoothing: antialiased;
}

.calc-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Header & Branding */
.calc-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.calc-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-full);
  color: #a5b4fc;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.calc-brand svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.calc-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.75rem;
}

.calc-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 680px;
  margin: 0 auto;
}

/* Glass Card Shell */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  transition: border-color var(--transition-normal);
}

/* Calculator Grid */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

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

.section-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-title svg {
  color: var(--accent-primary);
}

/* Form Field Groups */
.form-group {
  margin-bottom: 1.75rem;
}

.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.form-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: help;
  position: relative;
}

.tooltip-icon:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #e2e8f0;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  white-space: normal;
  width: 220px;
  border: 1px solid var(--card-border);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  z-index: 10;
  pointer-events: none;
  font-weight: 400;
}

/* Numeric Input Pill */
.input-number-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-symbol {
  position: absolute;
  left: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
}

.input-number {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.4rem 0.6rem 0.4rem 1.8rem;
  width: 130px;
  text-align: right;
  transition: all var(--transition-fast);
}

.input-number:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

/* Slider Controls */
.slider-container {
  position: relative;
  margin-top: 0.5rem;
}

.calc-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 12px var(--accent-primary), 0 2px 6px rgba(0, 0, 0, 0.4);
  border: 3px solid var(--accent-primary);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.calc-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Option Cards (Match Type & Industry) */
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.option-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.option-card:hover {
  background: var(--card-bg-hover);
  border-color: rgba(255, 255, 255, 0.18);
}

.option-card input[type="radio"] {
  accent-color: var(--accent-primary);
  margin-top: 0.25rem;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.option-card.selected {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px var(--accent-primary-glow);
}

.option-info {
  flex: 1;
}

.option-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.option-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.option-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.badge-danger {
  background: rgba(244, 63, 94, 0.2);
  color: #fca5a5;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fde047;
}

.badge-success {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.option-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Custom Dropdown Select */
.calc-select {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.calc-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.calc-select option {
  background: #0f172a;
  color: #ffffff;
}

/* Toggle Switch Card */
.toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
}

.toggle-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 80%;
}

.toggle-subtext {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 0.15rem;
}

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

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

.slider-switch {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.3s;
  border-radius: 34px;
}

.slider-switch:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

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

input:checked + .slider-switch:before {
  transform: translateX(24px);
}

/* Dashboard Output Column */
.dashboard-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Primary Alert Hero Box */
.hero-alert-card {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.15) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid var(--accent-danger-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px var(--accent-danger-glow);
}

.hero-alert-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f43f5e, #fb7185);
}

.alert-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fca5a5;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.alert-value-large {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 3.5vw, 3rem);
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.alert-subtext {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.alert-subtext span {
  color: #fca5a5;
  font-weight: 600;
}

/* KPI Secondary Metrics Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

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

.kpi-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kpi-card.highlight-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(15, 23, 42, 0.6) 100%);
  border-color: var(--accent-success-border);
}

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

.kpi-value {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
}

.kpi-card.highlight-success .kpi-value {
  color: #34d399;
}

.kpi-footnote {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
}

/* Visual Spend Breakdown Bar */
.breakdown-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.breakdown-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
}

.progress-bar-stacked {
  height: 22px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  overflow: hidden;
  display: flex;
  margin-bottom: 0.75rem;
}

.bar-segment {
  height: 100%;
  transition: width var(--transition-normal);
  position: relative;
}

.bar-segment-wasted {
  background: linear-gradient(90deg, #f43f5e, #e11d48);
}

.bar-segment-efficient {
  background: linear-gradient(90deg, #6366f1, #3b82f6);
}

.breakdown-legend {
  display: flex;
  gap: 1.25rem;
  font-size: 0.8rem;
}

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

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-wasted { background: #f43f5e; }
.dot-efficient { background: #6366f1; }

/* Lead Capture CTA Card */
.lead-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.lead-card::before {
  content: "";
  position: absolute;
  top: -100px;
  right: -100px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

.lead-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 2rem auto;
}

.lead-badge {
  display: inline-block;
  padding: 0.25rem 0.85rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.lead-title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.lead-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
  max-width: 900px;
  margin: 0 auto;
}

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

.input-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.input-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.lead-input {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition-fast);
}

.lead-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.btn-cta {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 10px 25px var(--accent-primary-glow);
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(99, 102, 241, 0.4);
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
}

.btn-cta svg {
  width: 18px;
  height: 18px;
  transition: transform var(--transition-fast);
}

.btn-cta:hover svg {
  transform: translateX(4px);
}

.form-status {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.85rem;
  min-height: 24px;
}

.status-error { color: #f87171; }
.status-success { color: #34d399; }

/* Footer & Embed Link */
.calc-footer {
  margin-top: 2.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--card-border);
}

.embed-link {
  color: #a5b4fc;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.embed-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Modal for Embed Code */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(7, 10, 18, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #0f172a;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 25px 60px rgba(0,0,0,0.8);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
}

.close-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.embed-code-box {
  background: #070a12;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-family: monospace;
  font-size: 0.85rem;
  color: #a5b4fc;
  overflow-x: auto;
  margin-bottom: 1rem;
  word-break: break-all;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}
