:root {
  --bg: #081122;
  --bg-soft: #0f172a;
  --card: rgba(15, 23, 42, 0.78);
  --card-light: rgba(255, 255, 255, 0.06);
  --line: rgba(148, 163, 184, 0.18);
  --text: #e5eefc;
  --text-soft: #a8b4ca;
  --heading: #f8fbff;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --success: #22c55e;
  --danger: #f87171;
  --shadow: 0 18px 50px rgba(2, 6, 23, 0.35);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --max-width: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.16), transparent 24%),
    linear-gradient(180deg, #06101f 0%, #0b1324 55%, #0b1428 100%);
  min-height: 100vh;
}

img {
  max-width: 100%;
}

.page-shell {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 28px;
}

.hero__content,
.hero__badge-card,
.card {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.hero__content {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  padding: 36px;
  box-shadow: var(--shadow);
}

.eyebrow,
.section-tag,
.badge-card__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 14px 0 12px;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.04;
  color: var(--heading);
}

.hero__text,
.section-heading p,
.content-card p,
.note-card p,
.summary p,
.faq-item p,
.helper-text,
.site-footer p {
  color: var(--text-soft);
  line-height: 1.7;
}

.hero__highlights {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero__highlights li {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  font-size: 0.95rem;
  color: var(--text);
}

.hero__badge-card {
  min-height: 100%;
  border-radius: 28px;
  padding: 32px;
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.18), rgba(15, 23, 42, 0.92));
  border: 1px solid rgba(56, 189, 248, 0.26);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.badge-card__value {
  margin: 16px 0 10px;
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  font-weight: 800;
  color: var(--heading);
}

.badge-card__caption {
  color: #d7ecff;
}

.calculator-section {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: start;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.calculator-card,
.results-card,
.note-card,
.content-card {
  padding: 28px;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading h2,
.summary h3,
.note-card h3,
.content-card h2,
.faq-section h2 {
  margin: 10px 0 8px;
  color: var(--heading);
}

.section-heading--compact {
  margin-bottom: 18px;
}

.section-heading--center {
  text-align: center;
  margin: 44px 0 20px;
}

.calculator-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field span {
  font-weight: 600;
  color: var(--heading);
}

.field--full {
  grid-column: 1 / -1;
}

.input-wrap,
select,
.duration-number-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.input-wrap:focus-within,
select:focus,
.duration-number-wrap:focus-within,
input[type="range"]:focus {
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

input,
select,
button {
  font: inherit;
}

input[type="number"],
select {
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  appearance: textfield;
}

.input-prefix,
.input-suffix,
.duration-number-wrap span {
  color: var(--text-soft);
  font-weight: 600;
  white-space: nowrap;
}

.duration-controls {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 14px;
  align-items: center;
}

input[type="range"] {
  width: 100%;
  appearance: none;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.95), rgba(125, 211, 252, 0.25));
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: #0ea5e9;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(14, 165, 233, 0.4);
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: #0ea5e9;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(14, 165, 233, 0.4);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

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

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #052033;
  box-shadow: 0 12px 28px rgba(14, 165, 233, 0.24);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.helper-text,
.error-message {
  margin: 0;
  font-size: 0.96rem;
}

.error-message {
  color: var(--danger);
  min-height: 1.5em;
}

.results-panel {
  display: grid;
  gap: 20px;
}

.result-highlight {
  padding: 22px;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.18), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(56, 189, 248, 0.18);
  margin-bottom: 18px;
}

.result-highlight__label,
.result-box__label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-soft);
}

.result-highlight__value {
  display: block;
  font-size: clamp(2rem, 3vw, 2.7rem);
  color: var(--heading);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.result-box {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.result-box strong {
  font-size: 1.3rem;
  color: var(--heading);
}

.summary {
  padding: 18px;
  border-radius: 18px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.18);
}

.summary h3 {
  margin-top: 0;
}

.content-section,
.faq-section {
  margin-top: 24px;
}

.formula-box {
  margin-top: 18px;
  padding: 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.formula-box code {
  display: inline-block;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(14, 165, 233, 0.12);
  color: #dff6ff;
  font-size: 1rem;
  word-break: break-word;
}

.faq-list {
  display: grid;
  gap: 14px;
}

.faq-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--heading);
}

.faq-item p {
  margin: 12px 0 0;
}

.site-footer {
  padding-top: 28px;
  text-align: center;
}

@media (max-width: 960px) {
  .hero,
  .calculator-section {
    grid-template-columns: 1fr;
  }

  .hero__badge-card {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(calc(100% - 20px), var(--max-width));
    padding-top: 20px;
  }

  .hero__content,
  .hero__badge-card,
  .calculator-card,
  .results-card,
  .note-card,
  .content-card {
    padding: 22px;
  }

  .form-grid,
  .result-grid,
  .duration-controls {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
