:root {
  /* Color System */
  --bg-primary: #0b0f19;
  --bg-secondary: #0f172a;
  --bg-tertiary: #1e293b;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --secondary: #8b5cf6;
  --accent: #ec4899;
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  
  /* Layout & Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Resets & Document Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  padding: 2rem 1rem;
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.08) 0, transparent 50%),
    radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.05) 0, transparent 50%),
    radial-gradient(at 50% 50%, rgba(139, 92, 246, 0.03) 0, transparent 70%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Master Layout Framework */
.utility-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.utility-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.utility-header h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.utility-header p {
  color: var(--text-secondary);
  font-size: clamp(1rem, 2vw, 1.15rem);
  max-width: 680px;
  margin: 0 auto;
}

/* Calculator Matrix Grid */
.matrix-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .matrix-grid {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

/* Form Controls & Numerical Inputs */
.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.control-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.label-info-trigger {
  cursor: help;
  color: var(--primary);
  font-size: 0.8rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-currency-symbol {
  position: absolute;
  left: 1.25rem;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 1.1rem;
}

.input-field {
  width: 100%;
  padding: 1rem 1.25rem 1rem 2.25rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  background: rgba(15, 23, 42, 0.8);
}

/* Slider Controls */
.slider-container {
  margin-top: 1rem;
}

.range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  margin: 1rem 0;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
  transition: var(--transition-smooth);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: var(--secondary);
}

/* Custom Interactive Switches */
.switch-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 1.5rem;
}

.switch-label-group {
  display: flex;
  flex-direction: column;
}

.switch-title {
  font-weight: 600;
  color: var(--text-primary);
}

.switch-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

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

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-tertiary);
  transition: .4s;
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

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

input:checked + .slider-round {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

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

/* Premium Visual Outlines & Tax Indicators */
.metric-tile {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.metric-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

.metric-tile.tax-saved::before {
  background: var(--success);
}

.metric-tile.net-cost::before {
  background: var(--accent);
}

.metric-value-large {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.1;
  margin: 0.5rem 0;
  letter-spacing: -0.03em;
}

/* Live Dynamic Output Visualization */
.results-board {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.savings-banner {
  background: radial-gradient(circle at top right, var(--success-glow), transparent);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-align: center;
  position: relative;
}

.savings-banner .badge {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 1rem;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
  margin-bottom: 0.75rem;
}

/* Sophisticated Data Table for Depreciation Schedule */
.table-responsive-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.depreciation-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
  background: rgba(15, 23, 42, 0.4);
}

.depreciation-table th {
  background: rgba(30, 41, 59, 0.8);
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.depreciation-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.depreciation-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Call to Action & Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #fff;
  border: none;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.4);
  filter: brightness(1.1);
}

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

/* Specially Styled Required Classes */

.glass-card {
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  transition: var(--transition-smooth);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
}

.gradient-text {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.ad-container {
  min-height: 250px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 2rem 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.ad-label {
  position: absolute;
  top: -10px;
  left: 10px;
  background: #1e293b;
  padding: 0 8px;
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.animate-glow {
  filter: drop-shadow(0 0 15px rgba(59, 130, 246, 0.5));
  animation: pulsating-glow 3s infinite ease-in-out;
}

/* Subtle Interactive Animations */
@keyframes pulsating-glow {
  0%, 100% {
    filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 22px rgba(139, 92, 246, 0.75));
  }
}

/* Tooltips & Info Modals styling */
.info-tooltip {
  position: relative;
  display: inline-block;
}

.info-tooltip-text {
  visibility: hidden;
  width: 220px;
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  text-align: center;
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  position: absolute;
  z-index: 10;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.75rem;
  line-height: 1.4;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.info-tooltip:hover .info-tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Print/Audit Friendly Styles */
@media print {
  body {
    background: #fff;
    color: #000;
    padding: 0;
  }
  .glass-card, .ad-container, .btn-primary {
    border: 1px solid #ccc;
    background: #fff;
    box-shadow: none;
    color: #000;
  }
  .gradient-text {
    -webkit-text-fill-color: #000;
  }
  .ad-container {
    display: none !important; /* Hide ads on official print outs */
  }
}