:root {
  --bg-deep: #0d2138;
  --bg-mid: #123b58;
  --brand-teal: #1f8a8a;
  --brand-gold: #d0a969;
  --text-main: #17324a;
  --text-muted: #61758a;
  --surface: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.78);
  --border-soft: rgba(23, 50, 74, 0.1);
  --border-strong: rgba(23, 50, 74, 0.16);
  --shadow-lg: 0 30px 80px rgba(10, 26, 43, 0.18);
  --shadow-sm: 0 16px 36px rgba(10, 26, 43, 0.08);
  --success: #1f7a61;
  --danger: #c55d57;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(208, 169, 105, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(31, 138, 138, 0.22), transparent 26%),
    linear-gradient(180deg, #f8f5ef 0%, #edf3f7 42%, #eef2f5 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(16px);
  z-index: 0;
}

body::before {
  width: 240px;
  height: 240px;
  top: 8%;
  left: -80px;
  background: rgba(31, 138, 138, 0.1);
}

body::after {
  width: 300px;
  height: 300px;
  bottom: -110px;
  right: -90px;
  background: rgba(208, 169, 105, 0.14);
}

.page-shell {
  position: relative;
  z-index: 1;
  padding: 32px 0 64px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 3vw, 3.5rem);
  padding-bottom: clamp(4.5rem, 8vw, 7rem);
  border-radius: var(--radius-xl);
  color: #f8fbff;
  background:
    linear-gradient(135deg, rgba(6, 18, 32, 0.95), rgba(20, 59, 88, 0.92)),
    linear-gradient(160deg, rgba(31, 138, 138, 0.24), rgba(208, 169, 105, 0.16));
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -42% auto;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(208, 169, 105, 0.18), transparent 70%);
}

.hero-badge,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-badge {
  margin-bottom: 1rem;
  color: #fce7c1;
  background: rgba(208, 169, 105, 0.14);
  border: 1px solid rgba(252, 231, 193, 0.2);
}

.hero-brand {
  margin-bottom: 1.35rem;
}

.hero-logo {
  display: block;
  width: min(100%, 420px);
  height: auto;
  filter: drop-shadow(0 16px 32px rgba(7, 20, 34, 0.24));
}

.hero-card h1,
.wizard-header h2,
.step-heading h3,
.calc-panel-head h4,
.success-modal-content h3 {
  font-family: "DM Serif Display", serif;
  letter-spacing: -0.02em;
}

.hero-card h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.2rem, 4vw, 3.75rem);
  line-height: 1.05;
}

.hero-copy {
  max-width: 42rem;
  margin: 0;
  color: rgba(248, 251, 255, 0.82);
  font-size: 1.05rem;
  line-height: 1.75;
}

.hero-metrics {
  display: grid;
  gap: 1rem;
}

.metric-tile {
  position: relative;
  padding: 1.15rem 1.25rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.metric-tile strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 1.1rem;
}

.metric-tile span {
  color: rgba(248, 251, 255, 0.7);
  font-size: 0.95rem;
}

.wizard-card {
  margin-top: -28px;
  padding: clamp(1.4rem, 3vw, 2.5rem);
  border-radius: var(--radius-xl);
  background: var(--surface-soft);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-lg);
}

.wizard-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 1.75rem;
}

.section-kicker {
  color: var(--brand-teal);
  background: rgba(31, 138, 138, 0.08);
  border: 1px solid rgba(31, 138, 138, 0.12);
}

.wizard-header h2 {
  margin: 0.8rem 0 0.5rem;
  font-size: clamp(1.7rem, 3vw, 2.45rem);
}

.section-copy,
.step-heading p,
.calc-panel-head p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.75;
}

.wizard-progress-box {
  min-width: min(100%, 290px);
  padding: 1rem 1.15rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(23, 50, 74, 0.08);
  box-shadow: var(--shadow-sm);
}

.wizard-progress-labels {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
  font-weight: 700;
  color: var(--text-main);
}

.progress-track {
  height: 10px;
  background: rgba(18, 59, 88, 0.1);
  border-radius: 999px;
}

.progress-track .progress-bar {
  width: 20%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-teal), var(--brand-gold));
}

.stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.8rem;
}

.step-pill {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
  padding: 1rem 1.05rem;
  border-radius: 20px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text-main);
  font-weight: 700;
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    background-color 0.25s ease,
    box-shadow 0.25s ease;
}

.step-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(18, 59, 88, 0.08);
  font-size: 0.85rem;
}

.step-pill small {
  font-size: 0.84rem;
  text-align: left;
  color: var(--text-muted);
}

.step-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(31, 138, 138, 0.24);
}

.step-pill.active {
  background: linear-gradient(135deg, rgba(18, 59, 88, 0.98), rgba(31, 138, 138, 0.9));
  border-color: transparent;
  box-shadow: 0 18px 34px rgba(18, 59, 88, 0.22);
  color: #fff;
}

.step-pill.active small,
.step-pill.active span {
  color: #fff;
}

.step-pill.active span {
  background: rgba(255, 255, 255, 0.18);
}

.step-pill.completed {
  border-color: rgba(31, 138, 138, 0.18);
  background: rgba(31, 138, 138, 0.08);
}

.status-alert {
  border-radius: 18px;
  border: 1px solid rgba(197, 93, 87, 0.16);
}

.form-step {
  display: none;
  animation: fade-up 0.35s ease;
}

.form-step.active {
  display: block;
}

.step-heading {
  margin-bottom: 1.5rem;
}

.step-heading h3 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.55rem, 2.5vw, 2rem);
}

.form-label {
  margin-bottom: 0.6rem;
  font-weight: 700;
  color: var(--text-main);
}

.form-control,
.form-select,
.input-group-text {
  min-height: 56px;
  border-radius: 16px;
}

.form-control,
.form-select {
  border: 1px solid var(--border-strong);
  padding-inline: 1rem;
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.88);
  box-shadow: none;
}

.form-control::placeholder {
  color: #8b9aab;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(31, 138, 138, 0.5);
  box-shadow: 0 0 0 0.28rem rgba(31, 138, 138, 0.12);
}

.form-control.is-invalid,
.form-select.is-invalid,
.form-check-input.is-invalid {
  border-color: rgba(197, 93, 87, 0.7);
}

.form-control.is-valid,
.form-select.is-valid,
.form-check-input.is-valid {
  border-color: rgba(31, 122, 97, 0.64);
}

.form-text {
  margin-top: 0.6rem;
  color: var(--text-muted);
}

.content-panel,
.conditional-card,
.consent-box {
  padding: 1.3rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(23, 50, 74, 0.08);
  box-shadow: var(--shadow-sm);
}

.calculation-toggle-panel {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background:
    linear-gradient(140deg, rgba(31, 138, 138, 0.08), rgba(208, 169, 105, 0.08)),
    rgba(255, 255, 255, 0.92);
}

.calculation-toggle-panel .form-check {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0;
}

.calculation-toggle-panel .form-check-input {
  width: 3rem;
  height: 1.65rem;
  margin: 0;
}

.calculation-toggle-panel .form-check-label {
  font-weight: 700;
  color: var(--text-main);
}

.input-group-modern .input-group-text {
  border: 1px solid var(--border-strong);
  border-left: 0;
  color: var(--text-main);
  background: rgba(18, 59, 88, 0.06);
  font-weight: 700;
}

.input-group-modern .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group-modern .input-group-text {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.hint-card {
  margin: 0;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  background: rgba(208, 169, 105, 0.08);
  color: var(--text-main);
  line-height: 1.7;
}

.calc-panel {
  height: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(245, 250, 250, 0.92)),
    rgba(255, 255, 255, 0.92);
}

.calc-panel-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.calc-panel-head h4 {
  margin: 0.65rem 0 0;
  font-size: 1.8rem;
}

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

.calc-card {
  padding: 1rem;
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(233, 244, 244, 0.84));
  border: 1px solid rgba(23, 50, 74, 0.08);
}

.calc-card.total-card {
  background:
    linear-gradient(145deg, rgba(18, 59, 88, 0.98), rgba(31, 138, 138, 0.92));
  color: #fff;
}

.calc-card.total-card small,
.calc-card.total-card .calc-label {
  color: rgba(255, 255, 255, 0.78);
}

.calc-label {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.readonly-output {
  border: 0;
  padding: 0;
  min-height: auto;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 800;
  color: inherit;
  background: transparent;
  box-shadow: none;
}

.readonly-output:focus {
  box-shadow: none;
}

.readonly-output-pending {
  font-size: 1rem;
  color: var(--text-muted);
}

.calc-card small {
  display: block;
  margin-top: 0.55rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.formula-panel {
  margin-top: 1.2rem;
  padding: 1.1rem 1.2rem;
  border-radius: 20px;
  background: rgba(18, 59, 88, 0.05);
  border: 1px solid rgba(18, 59, 88, 0.08);
}

.formula-panel h5 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 800;
}

.formula-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.calc-notes-panel {
  background:
    linear-gradient(140deg, rgba(18, 59, 88, 0.04), rgba(31, 138, 138, 0.06)),
    rgba(255, 255, 255, 0.92);
}

.calc-notes-panel h5 {
  margin: 0.95rem 0 0.45rem;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
}

.calc-notes-copy {
  margin: 0 0 1rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.share-panel {
  background:
    linear-gradient(140deg, rgba(18, 59, 88, 0.06), rgba(208, 169, 105, 0.12)),
    rgba(255, 255, 255, 0.9);
}

.form-range {
  height: 3rem;
}

.form-range::-webkit-slider-runnable-track {
  height: 0.65rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(31, 138, 138, 0.2), rgba(208, 169, 105, 0.45));
}

.form-range::-webkit-slider-thumb {
  margin-top: -7px;
  width: 24px;
  height: 24px;
  border: 3px solid #fff;
  background: var(--bg-mid);
  box-shadow: 0 8px 18px rgba(18, 59, 88, 0.2);
}

.form-range::-moz-range-track {
  height: 0.65rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(31, 138, 138, 0.2), rgba(208, 169, 105, 0.45));
}

.form-range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 3px solid #fff;
  background: var(--bg-mid);
  box-shadow: 0 8px 18px rgba(18, 59, 88, 0.2);
}

.share-split {
  display: grid;
  gap: 0.85rem;
}

.share-split article {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(23, 50, 74, 0.08);
}

.share-split span {
  color: var(--text-muted);
  font-weight: 700;
}

.share-split strong {
  font-size: 1.25rem;
}

.option-check {
  margin: 0;
  padding: 0.8rem 1rem 0.8rem 2.5rem;
  border-radius: 16px;
  background: rgba(18, 59, 88, 0.04);
  border: 1px solid rgba(18, 59, 88, 0.08);
}

.option-check .form-check-input {
  margin-top: 0.35rem;
}

.option-check .form-check-label {
  font-weight: 700;
}

.consent-box {
  background:
    linear-gradient(145deg, rgba(31, 138, 138, 0.08), rgba(255, 255, 255, 0.96));
}

.consent-box .form-check {
  margin: 0;
}

.consent-box .form-check-input {
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.2rem;
}

.consent-box .form-check-label {
  margin-left: 0.3rem;
  line-height: 1.8;
}

.wizard-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 2rem;
}

.wizard-actions-spacer {
  flex: 1;
}

.btn {
  min-height: 54px;
  padding-inline: 1.5rem;
  border-radius: 16px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.btn-primary {
  border: 0;
  background: linear-gradient(135deg, var(--bg-mid), var(--brand-teal));
  box-shadow: 0 16px 28px rgba(18, 59, 88, 0.18);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background: linear-gradient(135deg, #0f3049, #18797c) !important;
}

.btn-outline-secondary {
  border: 1px solid rgba(23, 50, 74, 0.18);
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.6);
}

.success-modal-content {
  border: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(13, 33, 56, 0.98), rgba(31, 138, 138, 0.94));
  box-shadow: var(--shadow-lg);
}

.success-modal-content .modal-body {
  padding: 3rem 2rem;
  color: #fff;
}

.success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  margin-bottom: 1.15rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 2rem;
  font-weight: 900;
}

.success-modal-content .section-kicker {
  color: #fce7c1;
  background: rgba(208, 169, 105, 0.14);
  border-color: rgba(208, 169, 105, 0.25);
}

.success-modal-content h3 {
  margin: 1rem 0 0.8rem;
  font-size: 2rem;
}

.success-modal-content p {
  max-width: 26rem;
  margin: 0 auto 1.8rem;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.8;
}

textarea.form-control {
  min-height: 160px;
  resize: vertical;
  padding-top: 1rem;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1199px) {
  .stepper {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .wizard-card {
    margin-top: 1.75rem;
  }

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

  .stepper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .page-shell {
    padding: 20px 0 48px;
  }

  .hero-card,
  .wizard-card {
    border-radius: 24px;
  }

  .wizard-actions {
    flex-wrap: wrap;
  }

  .wizard-actions-spacer {
    display: none;
  }

  .wizard-actions .btn {
    width: 100%;
  }

  .wizard-header {
    gap: 0.9rem;
    margin-bottom: 0.9rem;
  }

  .wizard-progress-box {
    width: 100%;
    min-width: 0;
    padding: 0.8rem 0.9rem;
    border-radius: 16px;
  }

  .wizard-progress-labels {
    margin-bottom: 0.45rem;
    font-size: 0.88rem;
  }

  .progress-track {
    height: 7px;
  }

  .stepper {
    display: none;
  }

  .hero-logo {
    width: min(100%, 320px);
  }
}

@media (max-width: 575px) {
  .hero-card h1 {
    font-size: 2rem;
  }

  .wizard-header {
    margin-bottom: 1.25rem;
  }

  .success-modal-content .modal-body {
    padding: 2.3rem 1.3rem;
  }
}
