* {
  box-sizing: border-box;
}

:root {
  --bg: #08090b;
  --surface: rgba(18, 20, 24, 0.82);
  --surface-2: #111318;
  --border: rgba(255,255,255,.09);
  --text: #f4f4f5;
  --muted: #9b9da5;
  --red: #c51f32;
  --red-bright: #e52b40;
  --red-soft: rgba(197,31,50,.15);
  --green: #48d597;
  --yellow: #f1c75b;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -10%, rgba(197,31,50,.13), transparent 38%),
    var(--bg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.bg-glow {
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .09;
  pointer-events: none;
}
.glow-1 { background: #c51f32; top: 25%; left: -240px; }
.glow-2 { background: #c51f32; right: -250px; bottom: 5%; }

.header {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 15px;
}
.brand img {
  width: 76px;
  height: auto;
}
.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.brand h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -.03em;
}
.scale-badge, .pill {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.035);
  color: #c9cad0;
  border-radius: 999px;
  padding: 8px 13px;
  font-size: 12px;
  font-weight: 600;
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 25px 24px 45px;
}

.hero {
  padding: 48px 0 42px;
  max-width: 720px;
}
.pill {
  display: inline-block;
  color: #e7a4ac;
  border-color: rgba(197,31,50,.28);
  background: var(--red-soft);
}
.hero h2 {
  margin: 18px 0 13px;
  font-size: clamp(40px, 7vw, 68px);
  line-height: .98;
  letter-spacing: -.055em;
}
.hero h2 span {
  color: #aeb0b8;
}
.hero p {
  max-width: 580px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 15px;
  margin: 0;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.tab {
  position: relative;
  border: 0;
  background: transparent;
  color: #777a83;
  padding: 18px 8px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: .2s ease;
}
.tab.active {
  color: var(--text);
}
.tab.active::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: -1px;
  height: 2px;
  background: var(--red-bright);
  box-shadow: 0 0 15px rgba(229,43,64,.45);
}
.tab-number {
  color: var(--red-bright);
  font-size: 10px;
  letter-spacing: .1em;
  margin-right: 7px;
}

.panel {
  display: none;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.active-panel {
  display: block;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 27px;
}
.section-label {
  color: var(--red-bright);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .15em;
}
.section-heading h3 {
  margin: 7px 0 0;
  font-size: 24px;
  letter-spacing: -.03em;
}
.section-heading p {
  max-width: 270px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.field > span {
  color: #d7d8dc;
  font-size: 12px;
  font-weight: 600;
}
.field small {
  color: #777a83;
  font-weight: 500;
}
input, select {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  color: var(--text);
  background: #0d0f13;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  font: inherit;
  font-size: 14px;
  transition: .2s ease;
}
input:focus, select:focus {
  border-color: rgba(229,43,64,.65);
  box-shadow: 0 0 0 3px rgba(197,31,50,.10);
}
select {
  cursor: pointer;
}
select option {
  background: #111318;
}

.primary-btn {
  width: 100%;
  margin-top: 18px;
  height: 52px;
  border: 0;
  border-radius: 11px;
  background: var(--red);
  color: white;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  transition: .2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.primary-btn:hover {
  background: var(--red-bright);
  transform: translateY(-1px);
}
.primary-btn:active {
  transform: translateY(0);
}

.result {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 22px;
  background: #0d0f13;
}
.hidden {
  display: none;
}
.result-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .13em;
}
.result-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin: 8px 0;
}
.result-main strong {
  font-size: clamp(30px, 6vw, 48px);
  letter-spacing: -.05em;
}
.result-main span {
  color: var(--muted);
  font-size: 13px;
}
.result-detail {
  margin: 10px 0 0;
  color: #b4b6bd;
  line-height: 1.65;
  font-size: 13px;
}
.result-highlight {
  color: #fff;
  font-weight: 750;
}
.grade-big {
  font-size: 50px !important;
}
.result.s { border-color: rgba(72,213,151,.25); }
.result.s-star { border-color: rgba(241,199,91,.3); }
.result.u { border-color: rgba(197,31,50,.3); }

.rules, .conversion {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: 13px;
  overflow: hidden;
}
.rules div, .conversion div {
  padding: 14px;
  background: rgba(255,255,255,.018);
  text-align: center;
}
.rules div + div, .conversion div + div {
  border-left: 1px solid var(--border);
}
.rules b {
  display: block;
  font-size: 14px;
}
.rules span, .conversion span {
  color: var(--muted);
  font-size: 11px;
}
.rules .selected b {
  color: var(--red-bright);
}
.conversion strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.mode-switch {
  display: flex;
  gap: 7px;
  padding: 5px;
  margin-bottom: 22px;
  border-radius: 12px;
  background: #0b0d10;
  border: 1px solid var(--border);
}
.mode {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.mode.active {
  background: #1b1e24;
  color: white;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #62656d;
  font-size: 11px;
  padding: 24px 2px 0;
}

@media (max-width: 680px) {
  .header {
    padding: 22px 18px;
  }
  .container {
    padding: 18px 18px 35px;
  }
  .scale-badge {
    display: none;
  }
  .brand img {
    width: 64px;
  }
  .hero {
    padding: 38px 0 32px;
  }
  .hero h2 {
    font-size: 43px;
  }
  .panel {
    padding: 20px;
    border-radius: 17px;
  }
  .section-heading {
    display: block;
  }
  .section-heading p {
    max-width: none;
    margin-top: 10px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .rules, .conversion {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .rules div, .conversion div {
    padding: 11px 6px;
  }
  footer {
    flex-direction: column;
  }
}
