:root {
  --bg-lime: #c2ff7e;
  --bg-lime-soft: #edf8c9;
  --ink: #0f2940;
  --ink-soft: #4e6174;
  --navy: #102c46;
  --navy-deep: #091a2d;
  --teal: #1f8f96;
  --teal-soft: rgba(31, 143, 150, 0.12);
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --line: rgba(16, 44, 70, 0.12);
  --shadow: 0 24px 60px rgba(8, 25, 42, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.45), transparent 26%),
    linear-gradient(180deg, #e8f8b1 0%, #edf7d0 32%, #f5f9ec 100%);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

input,
select {
  width: 100%;
}

.page-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 30px 20px 52px;
}

.hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  position: relative;
  margin-bottom: 24px;
  min-height: 268px;
  padding: 34px 34px 26px;
  border-radius: 32px;
  background: url("/static/assets/banner-6.svg") center/cover no-repeat;
  color: #eff6cf;
  box-shadow: 0 28px 70px rgba(9, 26, 45, 0.24);
  overflow: hidden;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  max-width: 760px;
  width: min(62%, 760px);
  position: relative;
  z-index: 1;
}

.hero-logo {
  align-self: flex-end;
  width: clamp(230px, 24vw, 360px);
  max-width: 32%;
  margin-top: auto;
  margin-right: 12px;
  margin-bottom: -4px;
  object-fit: contain;
  object-position: right bottom;
  filter: drop-shadow(0 20px 30px rgba(9, 26, 45, 0.08));
}

.panel-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  font-weight: 700;
}

.panel-kicker {
  color: var(--teal);
}

.hero h1 {
  margin: 0;
  font-family: "Plus Jakarta Sans", "Space Grotesk", sans-serif;
  font-size: clamp(2.2rem, 4.2vw, 4rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.04em;
  text-shadow: 0 10px 24px rgba(3, 31, 76, 0.18);
}

.hero-summary {
  max-width: 58ch;
  margin: 16px 0 0;
  color: rgba(244, 255, 224, 0.84);
  font-size: 1rem;
  line-height: 1.65;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-tags span,
.result-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(212, 242, 95, 0.14);
  border: 1px solid rgba(212, 242, 95, 0.26);
  color: #edf8c9;
  font-size: 0.84rem;
  font-weight: 700;
}

.status-banner {
  margin-bottom: 20px;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(31, 143, 150, 0.12);
  color: var(--navy);
  border: 1px solid rgba(31, 143, 150, 0.2);
}

.status-banner.error {
  background: rgba(170, 29, 64, 0.08);
  color: #8d173b;
  border-color: rgba(170, 29, 64, 0.18);
}

.status-banner.hidden,
.hidden {
  display: none !important;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(360px, 0.92fr);
  gap: 22px;
}

.panel {
  padding: 24px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.panel-base {
  background: linear-gradient(180deg, rgba(31, 143, 150, 0.08), rgba(255, 255, 255, 0.92) 24%);
}

.panel-quote {
  background: linear-gradient(180deg, rgba(16, 44, 70, 0.08), rgba(255, 255, 255, 0.94) 26%);
}

.panel-result {
  background: linear-gradient(180deg, rgba(212, 242, 95, 0.18), rgba(255, 255, 255, 0.95) 28%);
}

.panel-history {
  background: linear-gradient(180deg, rgba(16, 44, 70, 0.06), rgba(255, 255, 255, 0.93) 24%);
}

.panel-wide {
  grid-column: 1 / -1;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.panel-header h2,
.config-summary h2,
.profile-group-header h3,
.cost-group h3 {
  margin: 0;
}

.config-accordion {
  width: 100%;
}

.config-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  cursor: pointer;
  list-style: none;
}

.config-summary::-webkit-details-marker {
  display: none;
}

.section-intro {
  margin: 8px 0 0;
  max-width: 78ch;
  color: var(--ink-soft);
  line-height: 1.55;
}

.summary-hint {
  white-space: nowrap;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(16, 44, 70, 0.08);
  color: var(--navy);
  font-size: 0.92rem;
  font-weight: 700;
}

.config-accordion[open] .config-summary {
  margin-bottom: 20px;
}

.panel-actions {
  display: flex;
  gap: 10px;
}

.config-actions {
  justify-content: flex-end;
  margin-bottom: 18px;
}

.profile-groups {
  display: grid;
  gap: 16px;
}

.profile-group {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 247, 248, 0.96));
  border: 1px solid rgba(16, 44, 70, 0.08);
}

.profile-group.muted-group {
  opacity: 0.62;
}

.profile-group-header {
  margin-bottom: 14px;
}

.profile-group-header p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.5;
}

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

.form-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quote-top-grid {
  margin-bottom: 14px;
}

.form-grid label,
.check {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.form-grid label span,
.check span {
  font-weight: 700;
  color: var(--ink);
}

.span-2 {
  grid-column: span 2;
}

input,
select {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(16, 44, 70, 0.14);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.autocomplete-field {
  position: relative;
}

.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 40;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(16, 44, 70, 0.12);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(16, 44, 70, 0.16);
}

.autocomplete-powered {
  padding: 4px 8px 8px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.autocomplete-option {
  width: 100%;
  padding: 12px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--navy);
  text-align: left;
  box-shadow: none;
}

.autocomplete-option:hover {
  background: rgba(16, 44, 70, 0.06);
  transform: none;
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(31, 143, 150, 0.45);
  box-shadow: 0 0 0 4px rgba(31, 143, 150, 0.12);
}

.button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--navy), #16446e);
  color: #f8ffde;
  font-weight: 700;
  box-shadow: 0 14px 24px rgba(16, 44, 70, 0.2);
}

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

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.88);
  color: var(--navy);
  border: 1px solid rgba(16, 44, 70, 0.12);
  box-shadow: none;
}

.button-strong {
  width: 100%;
  margin-top: 18px;
  background: linear-gradient(135deg, var(--navy), #1b5670 52%, #7fd748 100%);
}

.inline-note,
.route-summary,
.result-empty,
.placeholder-card {
  border-radius: 18px;
}

.inline-note {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: rgba(16, 44, 70, 0.06);
  color: var(--ink-soft);
  line-height: 1.55;
}

.placeholder-card {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
  padding: 16px 18px;
  background: rgba(212, 242, 95, 0.22);
  border: 1px solid rgba(127, 215, 72, 0.28);
  color: var(--navy);
}

.toggle-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.check {
  flex-direction: row;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(16, 44, 70, 0.08);
}

.check input {
  inline-size: 18px;
  block-size: 18px;
}

.route-summary,
.result-empty {
  margin-top: 18px;
  padding: 16px 18px;
  background: rgba(31, 143, 150, 0.08);
  color: var(--ink-soft);
  line-height: 1.55;
}

.route-line + .route-line {
  margin-top: 6px;
}

.route-note {
  margin-top: 8px;
}

.api-note {
  margin: 14px 0 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.quote-guidance {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
}

.guidance-item {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(16, 44, 70, 0.08);
  background: rgba(255, 255, 255, 0.78);
}

.guidance-item strong {
  display: block;
  margin-bottom: 4px;
  color: var(--navy);
}

.guidance-item span {
  color: var(--ink-soft);
  line-height: 1.5;
}

.result-card {
  display: grid;
  gap: 16px;
}

.result-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.result-chip {
  color: var(--navy);
  background: rgba(16, 44, 70, 0.08);
  border-color: rgba(16, 44, 70, 0.12);
}

.result-chip-dark {
  background: var(--navy);
  color: #f4ffe0;
}

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

.metric {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(16, 44, 70, 0.08);
}

.metric-emphasis {
  background: linear-gradient(135deg, rgba(212, 242, 95, 0.32), rgba(31, 143, 150, 0.14));
}

.metric-label {
  display: block;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.metric-value {
  display: block;
  margin-top: 8px;
  color: var(--navy);
  font-size: 1.32rem;
  font-weight: 700;
}

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

.cost-group {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(16, 44, 70, 0.08);
}

.cost-group-full {
  margin-top: 0;
}

.cost-group h3 {
  color: var(--navy);
  font-size: 1rem;
}

.breakdown-table,
.history-table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
}

.breakdown-table td,
.history-table th,
.history-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(16, 44, 70, 0.08);
  text-align: left;
}

.history-table th {
  color: var(--ink-soft);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.row-total td {
  font-weight: 700;
  color: var(--navy);
}

.row-grand-total td {
  font-weight: 800;
  color: var(--navy);
  font-size: 1.04rem;
}

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

.link-row a {
  color: var(--navy);
  text-decoration: none;
  border-bottom: 1px solid rgba(16, 44, 70, 0.18);
}

.pac-container {
  z-index: 9999 !important;
  border-radius: 16px;
  border: 1px solid rgba(16, 44, 70, 0.08);
  box-shadow: 0 20px 40px rgba(16, 44, 70, 0.14);
}

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .result-grid,
  .cost-stack,
  .form-grid,
  .form-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 18px 14px 36px;
  }

  .hero,
  .panel-header,
  .config-summary,
  .panel-actions,
  .toggle-row {
    flex-direction: column;
  }

  .hero {
    align-items: flex-start;
    min-height: auto;
    gap: 18px;
  }

  .hero-copy,
  .hero-logo {
    width: 100%;
    max-width: 100%;
    margin-right: 0;
  }

  .hero-logo {
    align-self: flex-end;
  }

  .result-grid,
  .cost-stack,
  .form-grid,
  .form-grid.compact {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }
}
