:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-muted: #eef6f4;
  --text: #18212f;
  --muted: #687385;
  --line: #dce4ee;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --gold: #f2b705;
  --rose: #fce7f3;
  --success: #ecfdf5;
  --shadow: 0 18px 50px rgba(22, 35, 56, 0.1);
  --radius: 8px;
  --max: 1120px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(120deg, rgba(15, 118, 110, 0.08), rgba(37, 99, 235, 0.08) 46%, transparent 47%),
    var(--bg);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.fixed-actions {
  position: fixed;
  z-index: 20;
  top: 18px;
  left: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.right-actions {
  display: flex;
  gap: 10px;
  pointer-events: auto;
}

.ghost-button,
.primary-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 16px;
  font-weight: 700;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.88);
  border-color: var(--line);
  box-shadow: 0 8px 30px rgba(23, 34, 50, 0.08);
  pointer-events: auto;
}

.ghost-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.ghost-button:focus-visible,
.primary-button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 2px;
}

.primary-button {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 14px 34px rgba(15, 118, 110, 0.23);
}

.primary-button:hover {
  background: var(--primary-dark);
}

.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

main {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 92px 20px 56px;
}

.page {
  display: none;
}

.page.is-active {
  display: block;
}

.home-grid {
  display: grid;
  min-height: calc(100vh - 148px);
  grid-template-columns: minmax(0, 1.06fr) minmax(300px, 0.74fr);
  gap: 34px;
  align-items: center;
}

.intro-panel {
  padding: 40px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(220, 228, 238, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 2.25rem;
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 1.08rem;
}

.lead,
.section-heading p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.project-form {
  margin-top: 34px;
}

.project-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 800;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

input[type="text"] {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
  color: var(--text);
  background: #ffffff;
}

.quote-preview {
  position: relative;
  min-height: 420px;
  display: grid;
  gap: 18px;
  align-content: center;
}

.quote-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.quote-card span {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.quote-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
}

.quote-card-main {
  margin-right: 50px;
  border-top: 5px solid var(--primary);
}

.quote-card-accent {
  margin-left: 80px;
  border-top: 5px solid var(--accent);
}

.quote-card-soft {
  margin-right: 22px;
  border-top: 5px solid var(--gold);
}

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

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

.total-card,
.summary-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 36px rgba(23, 34, 50, 0.07);
}

.question-form {
  display: grid;
  gap: 18px;
}

.question-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 36px rgba(23, 34, 50, 0.06);
}

.question-card header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(238, 246, 244, 0.92), rgba(219, 234, 254, 0.55));
}

.question-number {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  color: #ffffff;
  background: var(--primary);
  border-radius: 50%;
  font-size: 0.88rem;
  font-weight: 900;
}

.question-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
}

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

.option {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
  min-height: 74px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.option:hover {
  border-color: rgba(15, 118, 110, 0.4);
}

.option input {
  margin-top: 3px;
  accent-color: var(--primary);
}

.option-title {
  display: block;
  color: var(--text);
  font-weight: 800;
  line-height: 1.35;
}

.option:has(input:checked) {
  border-color: var(--primary);
  background: var(--success);
}

.form-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
  padding: 16px 0 4px;
  background: linear-gradient(180deg, rgba(246, 248, 251, 0), var(--bg) 36%);
}

.total-card {
  padding: 24px;
}

.total-card span {
  color: var(--muted);
  font-weight: 800;
}

.total-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2.15rem;
  line-height: 1.1;
}

.total-card p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.total-card.secondary {
  background: var(--surface-muted);
}

.summary-panel {
  overflow: hidden;
}

.summary-header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.summary-header span {
  color: var(--muted);
  font-weight: 800;
}

.breakup-list {
  display: grid;
}

.breakup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.breakup-row:last-child {
  border-bottom: 0;
}

.base-row {
  background: linear-gradient(90deg, rgba(238, 246, 244, 0.95), rgba(219, 234, 254, 0.52));
}

.breakup-row strong {
  display: block;
  margin-bottom: 4px;
}

.breakup-row span,
.breakup-row p {
  color: var(--muted);
}

.breakup-row p {
  margin-bottom: 0;
  line-height: 1.55;
}

.breakup-amount {
  color: var(--text);
  font-weight: 900;
  white-space: nowrap;
}

.empty-state {
  padding: 28px 20px;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 840px) {
  main {
    padding-top: 86px;
  }

  .home-grid,
  .result-grid,
  .option-list {
    grid-template-columns: 1fr;
  }

  .home-grid {
    min-height: auto;
  }

  .intro-panel {
    padding: 28px;
  }

  .quote-preview {
    min-height: 0;
  }

  .quote-card-main,
  .quote-card-accent,
  .quote-card-soft {
    margin: 0;
  }
}

@media (max-width: 560px) {
  .fixed-actions {
    top: 10px;
    left: 10px;
    right: 10px;
  }

  main {
    padding-left: 12px;
    padding-right: 12px;
  }

  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .question-card header,
  .option-list,
  .summary-header,
  .breakup-row {
    padding-left: 14px;
    padding-right: 14px;
  }

  .breakup-row {
    grid-template-columns: 1fr;
  }

  .breakup-amount {
    white-space: normal;
  }
}
