.wizard {
  display: grid;
  gap: 2rem;
}

.wizard-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.wizard-title {
  font-size: 2.1rem;
  font-weight: 700;
  color: #0f172a;
}

.wizard-subtitle {
  margin-top: 0.5rem;
  max-width: 520px;
  color: #475569;
}

.wizard-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-tertiary {
  border-radius: 999px;
  border: 1px solid rgba(14, 165, 233, 0.35);
  background: rgba(14, 165, 233, 0.08);
  color: #0284c7;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  transition: background 150ms ease, border-color 150ms ease;
}

.btn-tertiary:hover {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.5);
}

.wizard-steps {
  display: grid;
  grid-auto-flow: column;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wizard-step-indicator {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 0.75rem 1.1rem;
  border: 1px solid transparent;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.wizard-step-indicator .step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.18);
  color: #0284c7;
  font-weight: 600;
}

.wizard-step-indicator .step-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}

.wizard-step-indicator.is-active {
  border-color: rgba(14, 165, 233, 0.45);
  background: rgba(14, 165, 233, 0.12);
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.2);
}

.wizard-form {
  position: relative;
  border-radius: 2rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.92));
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.15);
  overflow: hidden;
  display: grid;
  gap: 2rem;
  padding: 2.5rem 2.75rem 3.25rem;
  min-height: 360px;
}

.wizard-panel {
  display: none;
  animation: fade-in 220ms ease;
  min-height: 200px;
  margin-bottom: 1.75rem;
}

.wizard-panel.is-active {
  display: block;
}

.field-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: stretch;
}

.field-slot {
  display: flex;
}

.field {
  flex: 1;
  display: grid;
  grid-template-rows: minmax(38px, auto) minmax(64px, auto) minmax(40px, auto);
  align-items: stretch;
  gap: 0.55rem;
}

.field-input {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #ffffff;
  padding: 0.65rem 0.85rem 0.65rem;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  min-height: 64px;
}

.field-input input[readonly] {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.3);
  color: #334155;
}

.field-input .input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.field-input .input.with-icon {
  padding-inline-start: 2.75rem;
  border: none;
  background: transparent;
  box-shadow: none;
  height: 100%;
}

.field-input .input.with-icon:focus {
  border: none;
  box-shadow: none;
}

.field-input .tooltip-trigger {
  position: relative;
  inset: auto;
  transform: none;
  margin-left: auto;
}

.wizard-footer {
  position: sticky;
  bottom: -1px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2.75rem 1.5rem;
  margin: 2rem -2.75rem -3.25rem;
  background: linear-gradient(0deg, rgba(248, 250, 252, 0.95) 35%, rgba(248, 250, 252, 0));
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.wizard-footer-right {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.wizard-nav {
  border: none;
  background: transparent;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  padding: 0.75rem 1.2rem;
  border-radius: 0.9rem;
  transition: background 150ms ease, color 150ms ease;
}

.wizard-nav:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
}

.wizard-nav.prev[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

.wizard-submit {
  display: none;
  align-items: center;
}

.wizard-submit.is-visible {
  display: inline-flex;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .wizard-intro {
    flex-direction: column;
    align-items: flex-start;
  }

  .wizard-actions {
    width: 100%;
  }

  .wizard-steps {
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 640px) {
  .wizard-form {
    padding: 1.75rem 1.5rem 1.5rem;
    border-radius: 1.8rem;
  }

  .wizard-footer {
    position: static;
    margin: 0;
    padding: 1.25rem 0 0;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    background: none;
  }

  .wizard-footer-right {
    flex-direction: column;
    width: 100%;
  }

  .wizard-submit {
    width: 100%;
    justify-content: center;
  }
}
:root {
  color-scheme: light;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease, opacity 150ms ease;
}

.btn-primary {
  background: linear-gradient(135deg, #059669, #0ea5e9);
  color: #fff;
  box-shadow: 0 10px 20px rgba(14, 165, 233, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(5, 150, 105, 0.25);
}

.btn-primary:disabled,
.btn-primary[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary.is-loading::after {
  content: '';
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.65);
  border-top-color: transparent;
  margin-left: 0.65rem;
  animation: spin 750ms linear infinite;
}

.btn-primary.btn-success {
  background: linear-gradient(135deg, #22c55e, #0ea5e9);
}

.btn-secondary {
  background: #e2e8f0;
  color: #1e293b;
}

.btn-secondary:hover {
  background: #cbd5ff;
}

.label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: flex-end;
  min-height: 36px;
}

.input {
  border-radius: 0.9rem;
  border: 1px solid #cbd5f5;
  padding: 0.9rem 1rem;
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
  background: #f8fafc;
  width: 100%;
}

.input::placeholder {
  color: rgba(100, 116, 139, 0.55);
}

.input.with-icon {
  padding-inline-start: 2.75rem;
}

.input:focus {
  outline: none;
  border-color: #0ea5e9;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.field-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-start: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 1.1rem;
  opacity: 0.85;
}

.helper-text {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.45;
  display: flex;
  align-items: flex-end;
}



.tooltip-trigger {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: 0.75rem;
  transform: translateY(-50%);
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  border: none;
  background: #0f172a;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.tooltip-trigger:hover {
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.25);
}

.tooltip {
  position: fixed;
  max-width: 320px;
  background: #0f172a;
  color: #f8fafc;
  border-radius: 1rem;
  padding: 1rem;
  font-size: 0.85rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(148, 163, 184, 0.25);
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  left: -9999px;
  top: -9999px;
  transition: opacity 120ms ease;
}

.tooltip.visible {
  opacity: 1;
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: inherit;
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.25);
}

.tooltip[data-side='left']::after {
  right: -7px;
}

.tooltip[data-side='right']::after {
  left: -7px;
  transform: translateY(-50%) scaleX(-1);
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.modal.hidden {
  pointer-events: none;
  visibility: hidden;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.modal-content {
  position: relative;
  background: #ffffff;
  border-radius: 1.5rem;
  padding: 2rem;
  max-width: 28rem;
  width: min(90%, 28rem);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.35);
  animation: modal-in 220ms ease;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: none;
  background: #0f172a;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.hidden {
  display: none;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.results-section {
  margin-top: 4.5rem;
  display: grid;
  gap: 2.5rem;
}

.results-summary-wrapper {
  display: grid;
}


.results-grid-wrapper {
  display: grid;
}

.results-meta-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.summary-card {
  border-radius: 1.75rem;
  padding: 2rem;
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.12), rgba(5, 150, 105, 0.08));
  border: 1px solid rgba(14, 165, 233, 0.18);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.15);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.summary-card.summary-ready {
  transform: translateY(-4px);
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.3);
}

.summary-placeholder,
.summary-values {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  justify-content: space-between;
}

.summary-icon {
  width: 3.5rem;
  height: 3.5rem;
  display: grid;
  place-items: center;
  border-radius: 1.2rem;
  background: rgba(15, 23, 42, 0.1);
  font-size: 1.8rem;
}

.summary-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.7);
  font-weight: 600;
}

.summary-value {
  margin-top: 0.35rem;
  font-size: 2rem;
  font-weight: 700;
}

.summary-secondary {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.75);
}

.summary-secondary p {
  font-weight: 600;
  margin-top: 0.25rem;
}

.summary-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: #0f172a;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

.summary-description {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: rgba(15, 23, 42, 0.75);
}

.results-card {
  border-radius: 1.5rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 1.75rem;
  min-height: 280px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 1.25rem;
}

.results-card .rounded-2xl {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(5, 150, 105, 0.08));
}

.results-section .explanation-section {
  margin-top: 4rem;
  padding: 3.5rem;
  border-radius: 2rem;
  background: linear-gradient(140deg, rgba(236, 253, 245, 0.65), rgba(219, 234, 254, 0.65));
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.15);
  display: grid;
  gap: 2.5rem;
}

.results-section .explanation-header h2 {
  font-size: 1.9rem;
  font-weight: 700;
  color: #0f172a;
}

.results-section .explanation-header p {
  margin-top: 0.5rem;
  max-width: 640px;
  color: #475569;
  font-size: 1rem;
}

.results-section .explanation-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.results-section .explanation-card {
  border-radius: 1.5rem;
  padding: 1.75rem;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  display: grid;
  gap: 0.75rem;
}

.results-section .explanation-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #0f172a;
}

.results-section .explanation-card p {
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.5;
}


.result-grid {
  display: grid;
  gap: 1.25rem;
}

.result-description {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #475569;
}

.result-explanation {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.16);
  display: grid;
  gap: 0.35rem;
}

.result-explanation-label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(14, 165, 233, 0.9);
}

.result-explanation-text {
  font-size: 0.88rem;
  color: #0f172a;
  line-height: 1.45;
}

.placeholder-state {
  display: grid;
  gap: 1rem;
  justify-items: center;
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
}

.sparkline {
  width: 100%;
  height: 110px;
  border-radius: 1rem;
  background: radial-gradient(circle at top, rgba(14, 165, 233, 0.25), transparent 70%), linear-gradient(to right, rgba(148, 163, 184, 0.3) 20%, transparent 20%) 0 0 / 22px 100%;
  opacity: 0.85;
}

.comparison-card {
  border-radius: 1.5rem;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  padding: 1.75rem;
  color: #e2e8f0;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.35);
}

.share-card {
  border-radius: 1.5rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 1.75rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

#calculator-form {
  width: 100%;
  max-width: 100%;
}

.form-layout {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

@media (max-width: 1024px) {
  .form-cta {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .results-sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  #calculator-form {
    padding: 1.2rem;
    gap: 1.75rem;
  }
}

@media (max-width: 640px) {
  .btn-primary,
  .btn-secondary {
    width: 100%;
  }

  .form-cta {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .form-section {
    padding: 1.35rem 1.1rem 1.15rem;
    border-radius: 1.35rem;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(226, 232, 240, 0.85);
    background: #ffffff;
  }

  .form-section + .form-section {
    margin-top: 0.25rem;
  }

  .form-section-header {
    align-items: center;
  }

  .field {
    padding: 0.35rem 0.6rem 0.75rem;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.85);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(241, 245, 249, 0.95));
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  }

  .field .label {
    margin-inline: 0.1rem;
  }

  .helper-text {
    margin-inline: 0.1rem;
  }

  .field-wrapper {
    margin-top: 0.4rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #ffffff;
    padding: 0.35rem 0.5rem;
    display: flex;
    align-items: center;
  }

  .input.with-icon {
    padding-inline-start: 2.35rem;
    background: transparent;
    border: none;
    flex: 1;
  }

  .input {
    background: transparent;
    border: none;
    box-shadow: none;
    width: 100%;
  }

  .tooltip-trigger {
    position: relative;
    transform: none;
    margin-inline-start: 0.5rem;
    flex-shrink: 0;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .results-section {
    margin-top: 3.5rem;
    gap: 2rem;
  }

  .results-meta-grid {
    grid-template-columns: 1fr;
  }

  .results-section .explanation-section {
    margin-top: 2.5rem;
    padding: 2rem 1.5rem;
    border-radius: 1.75rem;
  }

  .results-section .explanation-grid {
    grid-template-columns: 1fr;
  }

  .mobile-sticky-cta {
    position: fixed;
    inset-inline: 0;
    inset-block-end: 0;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    padding: 1rem;
    box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.15);
    display: grid;
    gap: 0.75rem;
  }
}

.field-pair-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.field-group {
  display: grid;
  gap: 1.2rem;
}

