:root {
  --bg-1: #09111f;
  --bg-2: #162742;
  --bg-3: #0b1324;
  --card: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --text: #ffffff;
  --muted: #aeb9d3;
  --muted-2: #d9e1f2;
  --accent: #38bdf8;
  --accent-2: #24d0cf;
  --glass: blur(14px);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(37, 99, 235, 0.25), transparent 30%),
    linear-gradient(135deg, var(--bg-1), var(--bg-3) 50%, var(--bg-2));
}

img {
  max-width: 100%;
  display: block;
}

.app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 980px;
  padding: 38px 30px 26px;
  border-radius: 28px;
  background: var(--card);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hero {
  margin-bottom: 28px;
}

h1 {
  text-align: center;
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1.03;
  letter-spacing: -0.04em;
  margin: 0;
}

.subtitle {
  text-align: center;
  color: var(--muted-2);
  font-size: 1rem;
  margin: 10px auto 0;
  max-width: 40rem;
}

.controls {
  width: 100%;
  margin-bottom: 28px;
}

.field {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 18px;
}

.field label {
  margin-bottom: 10px;
  color: var(--muted-2);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
}

.select-wrapper {
  position: relative;
  width: 100%;
  max-width: 420px;
}

.select-wrapper select {
  width: 100%;
  padding: 16px 48px 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.84);
  color: #111827;
  font-size: 1.05rem;
  font-weight: 600;
  appearance: none;
  cursor: pointer;
  outline: none;
  text-align: center;
  text-align-last: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 8px 20px rgba(0, 0, 0, 0.12);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.select-wrapper select:hover {
  transform: translateY(-1px);
}

.select-wrapper select:focus {
  border-color: rgba(56, 189, 248, 0.85);
  box-shadow:
    0 0 0 4px rgba(56, 189, 248, 0.18),
    0 10px 24px rgba(0, 0, 0, 0.18);
}

.select-wrapper::after {
  content: "▾";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #334155;
  pointer-events: none;
  font-size: 0.95rem;
}

button {
  width: 100%;
  border: none;
  padding: 18px 20px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.05rem;
  background: linear-gradient(90deg, #38bdf8, #4aa8f0);
  color: #072033;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(56, 189, 248, 0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(56, 189, 248, 0.28);
}

button:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
}

.progress-wrap {
  margin: 26px 0 30px;
}

.progress-bar {
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

#progressFill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 0.2s ease;
}

.results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.box {
  min-height: 170px;
  height: 170px;
  padding: 20px 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.04));
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 10px 26px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, background 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.box:hover {
  transform: translateY(-3px);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.05));
}

.label {
  display: block;
  color: #d5dcef;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
  opacity: 0.95;
}

.value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  width: 100%;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.value-number {
  display: inline-block;
  min-width: 4.2ch;
  text-align: right;
  font-size: clamp(2rem, 3vw, 2.8rem);
}

.value-unit {
  display: inline-block;
  min-width: 2.8ch;
  text-align: left;
  font-size: 1.15rem;
  color: #dce7f8;
  font-weight: 700;
}

.value-unit.wide {
  min-width: 4.6ch;
}

.metric-note {
  margin-top: 10px;
  min-height: 18px;
  font-size: 0.82rem;
  color: var(--muted);
  opacity: 0.9;
}

.site-footer {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  text-align: left;
}

.footer-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 18px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.footer-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.footer-small {
  color: #c7d2e6;
  font-size: 0.95rem;
}

.footer-company {
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
  font-size: 1rem;
}

.footer-company:hover {
  color: var(--accent);
}

@media (max-width: 900px) {
  .results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app {
    padding: 16px;
  }

  .card {
    padding: 28px 18px 22px;
    border-radius: 22px;
  }

  .hero {
    margin-bottom: 22px;
  }

  .subtitle {
    font-size: 0.95rem;
  }

  .controls {
    margin-bottom: 22px;
  }

  .field {
    margin-bottom: 14px;
  }

  .select-wrapper {
    max-width: 100%;
  }

  .select-wrapper select {
    font-size: 1rem;
    padding: 15px 44px 15px 16px;
  }

  button {
    padding: 16px 18px;
    font-size: 1rem;
  }

  .progress-wrap {
    margin: 22px 0 24px;
  }

  .results {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .box {
    height: 156px;
    min-height: 156px;
    padding: 18px 16px;
    border-radius: 20px;
  }

  .value-number {
    font-size: 2.2rem;
  }

  .value-unit {
    font-size: 1rem;
  }

  .metric-note {
    font-size: 0.8rem;
  }

  .site-footer {
    margin-top: 28px;
    padding-top: 20px;
  }

  .footer-brand {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .footer-logo {
    width: 56px;
    height: 56px;
  }
}

@media (max-width: 380px) {
  .card {
    padding: 22px 14px 18px;
  }

  h1 {
    font-size: 2rem;
  }

  .value {
    gap: 6px;
  }

  .value-number {
    min-width: 3.8ch;
    font-size: 1.95rem;
  }

  .value-unit.wide {
    min-width: 4.2ch;
  }
}
