:root {
  --bg: radial-gradient(1200px 600px at 10% 10%, #fff0f5 0%, #ffffff 40%, #fefefe 100%);
  --calc-ar: 5 / 7;
}

html, body {
  height: 100%;
}

body {
  background: var(--bg);
}

html body {
  padding-top: 0;
}

.calc-wrap {
  aspect-ratio: var(--calc-ar);
  width: min(100vw, calc(100vh * var(--calc-ar)));
  height: auto;
}

.card, .card-body {
  height: 100%;
}

.card-body {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.form-container {
  flex: 1;
}

.nav-pills {
  border-bottom: 2px solid #dee2e6;
  padding-bottom: 8px;
}

.nav-pills .nav-link {
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  white-space: nowrap;
}

.calc-question h5 {
  text-align: center;
  color: #495057;
  font-size: 1.1rem;
}

.highlight {
  color: #0d6efd;
  font-weight: 700;
}

.result-box {
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 0.5rem;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.result-label {
  color: rgba(255,255,255,0.9);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.result-value {
  color: white;
  font-size: 2.5rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
}

.explanation-box {
  padding: 12px;
  background: #f8f9fa;
  border-radius: 0.375rem;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  text-align: center;
  color: #6c757d;
}

.discount-results {
  padding: 20px;
  background: #f8f9fa;
  border-radius: 0.5rem;
  font-size: 1.1rem;
}

.quick-reference {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 0.375rem;
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.reference-item {
  padding: 8px;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  text-align: center;
  font-size: 0.9rem;
  font-family: 'Courier New', monospace;
}

@media (max-width: 575.98px) {
  .calc-wrap {
    width: 100vw;
    height: 100vh;
    aspect-ratio: auto;
  }

  .nav-pills .nav-link {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }

  .result-value {
    font-size: 2rem;
  }

  .reference-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 576px) and (max-width: 991.98px) {
  :root { 
    --calc-ar: 6 / 8; 
  }
}

@media (min-width: 992px) {
  :root { 
    --calc-ar: 5 / 7; 
  }
}
