:root {
  --bg-primary: #0a0e17;
  --bg-card: rgba(18, 25, 41, 0.85);
  --bg-card-hover: rgba(24, 34, 56, 0.95);
  --bg-input: #0f172a;
  --border: rgba(45, 62, 92, 0.6);
  --border-focus: #10b981;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.25);
  --cyan: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.2);
  --amber: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.2);
  --rose: #f43f5e;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 65%, rgba(6, 182, 212, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(245, 158, 11, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
  overflow-x: hidden;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem 1.5rem;
}

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

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--emerald);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.badge-tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #ffffff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.highlight-text {
  background: linear-gradient(135deg, var(--emerald) 20%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

/* Layout Grid */
.calculator-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

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

/* Card Styling */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.85rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(70, 95, 138, 0.7);
}

.card-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #ffffff;
}

.card-title .icon {
  font-size: 1.4rem;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.4rem;
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.form-val-display {
  color: var(--emerald);
  font-family: monospace;
  font-size: 1rem;
  font-weight: 700;
}

select, input[type="number"], input[type="text"] {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

select:focus, input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Custom Range Slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #1e293b;
  border-radius: 9999px;
  outline: none;
  margin: 0.5rem 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald-glow);
  cursor: pointer;
  transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Two-column Input Row */
.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

/* Toggles / Checkboxes */
.toggle-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  margin-top: 0.5rem;
}

.toggle-box:hover {
  border-color: var(--emerald);
}

.toggle-box input[type="checkbox"] {
  accent-color: var(--emerald);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.toggle-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
}

.toggle-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  display: block;
}

/* Results Section */
.hero-stat-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(6, 182, 212, 0.08) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-md);
  padding: 1.6rem;
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero-stat-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--emerald);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.hero-stat-value {
  font-size: clamp(2.4rem, 4vw, 3.2rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.hero-stat-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Comparison Metric Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-pill {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  transition: var(--transition);
}

.metric-pill:hover {
  border-color: rgba(148, 163, 184, 0.4);
}

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

.metric-val {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
}

.metric-val.ev {
  color: var(--emerald);
}

.metric-val.gas {
  color: var(--amber);
}

.metric-detail {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Cost Bar Breakdown */
.cost-breakdown-bar {
  margin-bottom: 1.75rem;
}

.bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.bar-track {
  height: 14px;
  background: #1e293b;
  border-radius: 9999px;
  overflow: hidden;
  display: flex;
}

.bar-fill-ev {
  background: linear-gradient(90deg, var(--emerald), var(--cyan));
  transition: width 0.4s ease;
}

.bar-fill-savings {
  background: rgba(16, 185, 129, 0.2);
  transition: width 0.4s ease;
}

/* Payback Card */
.payback-banner {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.payback-icon {
  font-size: 2rem;
}

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

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

/* Actions */
.action-row {
  display: flex;
  gap: 0.75rem;
}

.btn {
  flex: 1;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background: var(--emerald);
  color: #042f2e;
}

.btn-primary:hover {
  background: #34d399;
  box-shadow: 0 0 15px var(--emerald-glow);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.8);
}

/* Recommended Hardware / Affiliate Section */
.recommend-section {
  margin-top: 3.5rem;
}

.section-head {
  text-align: center;
  margin-bottom: 2rem;
}

.section-head h2 {
  font-size: 1.85rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.section-head p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.cards-carousel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

.hardware-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  position: relative;
}

.hardware-card:hover {
  transform: translateY(-4px);
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 12px 24px -10px rgba(6, 182, 212, 0.2);
}

.card-pill-tag {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cyan);
  background: rgba(6, 182, 212, 0.12);
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
}

.hardware-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.hardware-specs {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.hardware-price {
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 1rem;
}

.btn-affiliate {
  display: block;
  text-align: center;
  text-decoration: none;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--emerald);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  transition: var(--transition);
}

.btn-affiliate:hover {
  background: var(--emerald);
  color: #042f2e;
}

/* FAQ Accordion */
.faq-section {
  max-width: 800px;
  margin: 0 auto 4rem auto;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1.1rem 1.4rem;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.02rem;
  font-weight: 600;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-family: inherit;
}

.faq-question:hover {
  color: var(--emerald);
}

.faq-answer {
  padding: 0 1.4rem 1.1rem 1.4rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  display: none;
}

.faq-item.active .faq-answer {
  display: block;
}

.faq-item.active .faq-question {
  color: var(--emerald);
}

/* 1-Click Matchups Bar */
.matchups-bar {
  margin-bottom: 1.1rem;
  padding: 0.85rem 1rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.matchups-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.matchup-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.matchup-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(70, 95, 138, 0.5);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.matchup-btn:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--cyan);
  color: #ffffff;
}

.matchup-btn.active {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #042f2e;
  font-weight: 700;
  box-shadow: 0 0 12px var(--cyan-glow);
}

/* State Rankings Section */
.rankings-section {
  margin-top: 3.5rem;
  margin-bottom: 3.5rem;
}

.rankings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

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

.ranking-card {
  padding: 1.5rem;
}

.ranking-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.ranking-card-title.cheap {
  color: var(--emerald);
}

.ranking-card-title.expensive {
  color: var(--rose);
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ranking-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(45, 62, 92, 0.4);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.ranking-row:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: var(--emerald);
  transform: translateX(4px);
}

.ranking-rank {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-dim);
  width: 24px;
}

.ranking-name {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
}

.ranking-rate {
  font-size: 0.95rem;
  font-weight: 700;
  font-family: monospace;
}

.ranking-rate.cheap {
  color: var(--emerald);
}

.ranking-rate.expensive {
  color: var(--rose);
}

.ranking-cta {
  font-size: 0.75rem;
  color: var(--cyan);
  margin-left: 0.65rem;
  opacity: 0.8;
}

/* Footer */
footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(45, 62, 92, 0.3);
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
}

footer a:hover {
  color: var(--emerald);
}

/* Print Styles */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .card, .metric-pill, .hero-stat-card {
    background: #ffffff !important;
    border: 1px solid #cccccc !important;
    color: #000000 !important;
    box-shadow: none !important;
  }
  .recommend-section, .rankings-section, .faq-section, .btn, .badge-tag {
    display: none !important;
  }
}

