* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

:root {
  --bg-gradient: linear-gradient(135deg, #1d2671, #c33764);
  --container-bg: white;
  --text-color: #222;
  --subtitle-color: #666;
  --input-bg: white;
  --input-border: #ccc;
  --result-bg: #f4f6ff;
  --heading-color: #1d2671;
}

body.dark-mode {
  --bg-gradient: linear-gradient(135deg, #0f172a, #111827);
  --container-bg: #1e293b;
  --text-color: #f8fafc;
  --subtitle-color: #cbd5e1;
  --input-bg: #334155;
  --input-border: #475569;
  --result-bg: #334155;
  --heading-color: #93c5fd;
}

body {
  min-height: 100vh;
  background: var(--bg-gradient);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px;
  transition: background 0.4s ease;
}

.container {
  width: 100%;
  max-width: 850px;
  background: var(--container-bg);
  border-radius: 20px;
  padding: 35px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  transition: all 0.4s ease;
}

h1 {
  text-align: center;
  margin-bottom: 10px;
  color: var(--heading-color);
}

.subtitle {
  text-align: center;
  margin-bottom: 30px;
  color: var(--subtitle-color);
  font-size: 15px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
}

label {
  margin-bottom: 8px;
  font-weight: bold;
  color: var(--text-color);
}

input,
select {
  padding: 12px;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  outline: none;
  font-size: 15px;
  transition: 0.3s;
  background: var(--input-bg);
  color: var(--text-color);
}

input:focus,
select:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 8px rgba(124,58,237,0.3);
}

button {
  width: 100%;
  margin-top: 30px;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #1d2671, #c33764);
  color: white;
  font-size: 17px;
  cursor: pointer;
  transition: 0.3s;
}

button:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

.result-box {
  margin-top: 35px;
  display: none;
}

.result-box h2 {
  text-align: center;
  margin-bottom: 20px;
  color: var(--heading-color);
}

.result-card {
  background: var(--result-bg);
  padding: 18px;
  border-radius: 14px;
  margin-bottom: 15px;
  text-align: center;
  transition: 0.3s;
}

.result-card span {
  color: var(--subtitle-color);
  font-size: 14px;
}

.result-card h3 {
  margin-top: 8px;
  color: #c33764;
  font-size: 24px;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  border: none;
  background: white;
  color: black;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.25);
  z-index: 1000;
  transition: all 0.3s ease;
}

body.dark-mode .theme-toggle {
  background: #1e293b;
  color: white;
}

.theme-toggle:hover {
  transform: scale(1.08) rotate(8deg);
}

@media (max-width: 600px) {
  .container {
    padding: 25px;
  }

  .theme-toggle {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }
}

.charts-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 25px;
}

.chart-card {
  background: var(--result-bg);
  padding: 20px;
  border-radius: 16px;
  transition: 0.3s;
}

.chart-card canvas {
  width: 100% !important;
  height: 320px !important;
}

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

.meter-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 30px;
}

.progress-ring {
  position: relative;
  width: 180px;
  height: 180px;
}

.progress-svg {
  transform: rotate(-90deg);
  overflow: visible;
}

.progress-bg {
  fill: none;
  stroke: rgba(255,255,255,0.12);
  stroke-width: 12;
}

.progress-circle {
  fill: none;
  stroke: #22c55e;
  stroke-width: 12;
  stroke-linecap: round;

  stroke-dasharray: 471;
  stroke-dashoffset: 471;

  transition:
    stroke-dashoffset 1.5s ease,
    stroke 0.5s ease;

  filter: drop-shadow(0 0 10px rgba(34,197,94,0.7));
}

.meter-content {
  position: absolute;
  inset: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;
}

.meter-content h2 {
  font-size: 36px;
  color: var(--heading-color);
}

.meter-content p {
  margin-top: 5px;
  color: var(--subtitle-color);
  font-size: 14px;
}