:root {
  --bg: #050505;
  --bg-soft: rgba(12, 12, 12, 0.92);
  --panel: rgba(17, 17, 17, 0.92);
  --panel-border: rgba(255, 255, 255, 0.08);
  --card: rgba(255, 255, 255, 0.04);
  --text: #f7f3ef;
  --muted: #b8b1ad;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #d91515;
  --accent-strong: #ff3131;
  --accent-soft: rgba(217, 21, 21, 0.2);
  --success: #ffffff;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Outfit", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 20%, rgba(217, 21, 21, 0.18), transparent 30%),
    radial-gradient(circle at 85% 18%, rgba(255, 49, 49, 0.12), transparent 24%),
    linear-gradient(135deg, #020202 0%, #0a0a0a 45%, #151515 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 95%);
}

.scene {
  position: relative;
  min-height: 100dvh;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scene__glow {
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.5;
}

.scene__glow--left {
  left: 5%;
  top: 8%;
  background: rgba(217, 21, 21, 0.22);
}

.scene__glow--right {
  right: 6%;
  bottom: 10%;
  background: rgba(255, 49, 49, 0.16);
}

.calculator-card {
  position: relative;
  width: min(1180px, calc(100vw - 24px));
  padding: 18px;
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    var(--bg-soft);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.calculator-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.06) 45%, transparent 70%);
  transform: translateX(-70%);
  animation: shine 9s linear infinite;
  pointer-events: none;
}

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-bottom: 16px;
  text-align: center;
}

.hero__logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 0;
}

.hero__logo {
  width: min(220px, 24vw);
  height: auto;
  display: block;
  opacity: 0.96;
  filter: drop-shadow(0 5px 12px rgba(217, 21, 21, 0.1));
}

.hero__copy {
  display: grid;
  justify-items: center;
  gap: 0;
}

.eyebrow,
.table-panel__eyebrow,
.summary-panel__label {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.74rem;
  color: #ffb3b3;
}

.hero h1,
.table-panel h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.hero h1 {
  font-size: clamp(2.4rem, 4.6vw, 4.4rem);
  line-height: 0.92;
  text-wrap: unset;
}

.hero__text {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
  margin: 10px 0 0;
  text-wrap: pretty;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #e8dddd;
  white-space: nowrap;
  font-size: 0.82rem;
  align-self: center;
  margin-top: 4px;
}

.hero__badge-mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 0 18px rgba(217, 21, 21, 0.8);
}

.content-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 14px;
  margin-bottom: 14px;
}

.panel {
  border-radius: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.form-panel,
.summary-panel,
.table-panel {
  padding: 16px;
}

.form-panel {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.92rem;
  font-weight: 500;
  text-align: left;
  line-height: 1.35;
  text-wrap: pretty;
}

.field input,
.field select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.field input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.field input:focus,
.field select:focus {
  border-color: rgba(255, 49, 49, 0.88);
  box-shadow: 0 0 0 4px rgba(217, 21, 21, 0.14);
  transform: translateY(-1px);
}

.primary-button {
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  width: 100%;
  font: inherit;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 18px 40px rgba(217, 21, 21, 0.34);
}

.primary-button:hover {
  transform: translateY(-2px);
  filter: saturate(1.1);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  padding: 14px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03)),
    var(--card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.metric__label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.metric strong {
  font-size: clamp(1rem, 1.4vw, 1.35rem);
  line-height: 1.15;
}

.table-panel {
  position: relative;
  z-index: 1;
}

.table-panel__header {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  text-align: center;
}

.table-panel__hint {
  margin: 0;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
  font-size: 0.86rem;
  text-wrap: pretty;
}

.table-shell {
  overflow: auto;
  max-height: min(34dvh, 320px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

thead {
  background: linear-gradient(135deg, rgba(217, 21, 21, 0.95), rgba(255, 49, 49, 0.95));
}

th,
td {
  padding: 12px 10px;
  text-align: center;
}

th {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

tbody tr {
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.2s ease;
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.04);
}

tbody tr:hover {
  background: rgba(217, 21, 21, 0.1);
}

td {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #eef2fb;
}

td:last-child {
  color: var(--success);
  font-weight: 600;
}

.empty-state td {
  color: var(--muted);
  text-align: center;
  padding: 18px 12px;
}

@keyframes shine {
  0% {
    transform: translateX(-70%);
  }
  100% {
    transform: translateX(150%);
  }
}

@media (max-width: 900px) {
  .scene {
    align-items: start;
  }

  .calculator-card {
    width: min(760px, 100%);
    padding: 16px;
  }

  .hero__logo {
    width: min(210px, 36vw);
  }

  .hero h1 {
    font-size: clamp(1.9rem, 7vw, 3rem);
    text-wrap: balance;
  }

  .hero__text {
    font-size: 0.94rem;
    text-wrap: balance;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .table-shell {
    max-height: min(40dvh, 320px);
  }
}

@media (max-width: 600px) {
  .scene {
    padding: 10px;
    align-items: start;
  }

  .calculator-card {
    width: 100%;
    max-width: 100%;
    border-radius: 22px;
    padding: 14px;
  }

  .form-panel,
  .summary-panel,
  .table-panel {
    padding: 14px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .hero__badge {
    white-space: normal;
  }

  .hero__logo {
    width: min(190px, 48vw);
  }

  .hero__text {
    font-size: 0.9rem;
  }

  .field span {
    text-align: left;
  }

  .hero__badge {
    white-space: normal;
    max-width: 100%;
  }

  .table-shell {
    max-height: min(36dvh, 270px);
    width: 100%;
  }

  table {
    min-width: 520px;
  }
}
