:root {
  color-scheme: light;
  --brand-navy: #142645;
  --brand-navy-dark: #0c1a33;
  --brand-sky: #3f7edb;
  --brand-sky-light: #e6f0ff;
  --brand-rose: #c64348;
  --brand-rose-dark: #9b2c30;
  --brand-gold: #f3c15c;
  --surface: #f5f7fb;
  --surface-alt: #ffffff;
  --text-primary: #17212f;
  --text-muted: #4f5d73;
  --shadow-soft: 0 20px 45px rgba(20, 38, 69, 0.08);
  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-sm: 10px;
  font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--text-primary);
  font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--brand-navy);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 2px;
}

a:hover,
a:focus {
  text-decoration: underline;
}

button {
  font-family: inherit;
}

button,
input,
select,
textarea {
  color: inherit;
  font-size: 1rem;
}

:focus-visible {
  outline: 3px solid var(--brand-sky);
  outline-offset: 3px;
}

.site-header {
  background: linear-gradient(90deg, var(--brand-navy-dark), var(--brand-navy));
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 10px 30px rgba(12, 26, 51, 0.35);
}

.site-header .inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand img {
  height: 48px;
  width: auto;
}

.brand span {
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

.primary-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.98rem;
}

.primary-nav a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-weight: 500;
}

.primary-nav a:hover,
.primary-nav a:focus {
  color: #fff;
}

.header-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 600;
}

.header-cta a {
  color: #fff;
  text-decoration: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 4.5rem 0;
}

.hero {
  background: radial-gradient(circle at top left, rgba(63, 126, 219, 0.18), transparent 55%),
    radial-gradient(circle at top right, rgba(198, 67, 72, 0.2), transparent 60%),
    var(--surface);
  padding-top: 5.5rem;
  padding-bottom: 4.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 3.6rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero p {
  max-width: 580px;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 2.2rem 0 1.5rem;
}

.btn-primary,
.btn-secondary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.85rem 1.9rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(120deg, var(--brand-sky), var(--brand-rose));
  color: #fff;
  box-shadow: 0 15px 30px rgba(63, 126, 219, 0.3);
}

.btn-primary:hover,
.btn-primary:focus {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(63, 126, 219, 0.38);
}

.btn-secondary {
  background: #fff;
  color: var(--brand-navy);
  border: 2px solid rgba(20, 38, 69, 0.12);
}

.btn-secondary:hover,
.btn-secondary:focus {
  border-color: rgba(20, 38, 69, 0.28);
  transform: translateY(-1px);
}

.badge-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.badge {
  background: #fff;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 25px rgba(20, 38, 69, 0.08);
  border: 1px solid rgba(20, 38, 69, 0.05);
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.badge span {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.figure-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(20, 38, 69, 0.08);
}

.figure-card h2 {
  margin: 0;
  font-size: 1.85rem;
}

.section-heading {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 2.5rem auto;
}

.section-heading h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: 0.75rem;
}

.section-heading p {
  color: var(--text-muted);
  margin: 0;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 1.75rem;
  border: 1px solid rgba(20, 38, 69, 0.08);
  box-shadow: 0 15px 30px rgba(20, 38, 69, 0.05);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.card p {
  margin: 0;
  color: var(--text-muted);
}

.highlight {
  background: linear-gradient(135deg, rgba(63, 126, 219, 0.12), rgba(198, 67, 72, 0.12));
  border-radius: var(--radius-lg);
  padding: 3rem 2.25rem;
  box-shadow: var(--shadow-soft);
}

.highlight h3 {
  margin-top: 0;
  font-size: 2rem;
}

.highlight p {
  font-size: 1.05rem;
  color: var(--text-muted);
}

.estimator-section {
  background: #f9fbff;
}

.estimator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.chat-shell {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(20, 38, 69, 0.08);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.chat-log {
  padding: 1.75rem;
  overflow-y: auto;
  max-height: clamp(360px, 55dvh, 640px);
  scroll-behavior: smooth;
}

.chat-log::-webkit-scrollbar {
  width: 10px;
}

.chat-log::-webkit-scrollbar-thumb {
  background: rgba(20, 38, 69, 0.25);
  border-radius: 999px;
}

.chat-bubble {
  max-width: 85%;
  padding: 0.95rem 1.2rem;
  border-radius: 20px;
  margin-bottom: 1rem;
  word-break: break-word;
  font-size: 0.98rem;
  line-height: 1.5;
}

.chat-bubble.system {
  background: rgba(63, 126, 219, 0.12);
  color: var(--brand-navy);
  border-radius: 20px 20px 20px 6px;
}

.chat-bubble.user {
  margin-left: auto;
  background: linear-gradient(135deg, var(--brand-navy), var(--brand-sky));
  color: #fff;
  border-radius: 20px 20px 6px 20px;
}

.chat-composer {
  border-top: 1px solid rgba(20, 38, 69, 0.08);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(249, 251, 255, 0.8);
}

.composer-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

#promptText {
  font-weight: 600;
  font-size: 1.05rem;
}

#promptHelper {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.input-field,
textarea.input-field {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(20, 38, 69, 0.22);
  padding: 0.85rem 1rem;
  background: #fff;
  font-size: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

textarea.input-field {
  min-height: 110px;
  resize: vertical;
}

.input-field:focus {
  border-color: var(--brand-sky);
  box-shadow: 0 0 0 3px rgba(63, 126, 219, 0.15);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.checkbox-option {
  background: #fff;
  border: 1px solid rgba(20, 38, 69, 0.18);
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.95rem;
}

.checkbox-option input {
  margin-top: 0.2rem;
}

.composer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

#inputError {
  color: var(--brand-rose);
  font-size: 0.9rem;
  min-height: 1.2rem;
}

.chat-complete-note {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.summary-panel {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(20, 38, 69, 0.08);
  padding: 1.75rem;
  position: sticky;
  top: 96px;
}

.estimate-results {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.result-card {
  background: linear-gradient(135deg, rgba(63, 126, 219, 0.08), rgba(198, 67, 72, 0.08));
  border-radius: 14px;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(20, 38, 69, 0.08);
}

.result-label {
  font-weight: 600;
  color: var(--brand-navy);
}

.result-value {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0.15rem 0;
}

.result-subtext {
  margin: 0;
  color: var(--text-muted);
}

.cheat-sheet {
  background: rgba(20, 38, 69, 0.04);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(20, 38, 69, 0.08);
  margin-bottom: 1rem;
}

.cheat-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.cheat-sheet-text {
  white-space: pre-wrap;
  margin: 0.5rem 0 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.range-wrap {
  display: grid;
  gap: 0.35rem;
  align-items: center;
}

.input-range {
  width: 100%;
}

.range-value {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.summary-panel h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.progress-wrap {
  margin-bottom: 1.25rem;
}

.progress-bar {
  height: 10px;
  background: rgba(20, 38, 69, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(135deg, var(--brand-sky), var(--brand-rose));
  border-radius: inherit;
  transition: width 0.3s ease;
}

#progressText {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.summary-list {
  margin: 1.25rem 0;
  display: grid;
  gap: 1rem;
}

.summary-item {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(20, 38, 69, 0.08);
}

.summary-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.summary-item-label {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.summary-item-value {
  margin: 0;
  color: var(--text-muted);
  white-space: pre-wrap;
}

.notice {
  background: rgba(63, 126, 219, 0.1);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--brand-navy);
}

.checkbox-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.95rem;
  margin: 1.25rem 0 0.85rem;
}

.checkbox-consent input {
  margin-top: 0.25rem;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-submit {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(120deg, var(--brand-rose), var(--brand-navy));
  color: #fff;
  border: none;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-submit:hover,
.btn-submit:focus {
  transform: translateY(-1px);
  box-shadow: 0 15px 25px rgba(20, 38, 69, 0.25);
}

.btn-submit[disabled] {
  background: rgba(20, 38, 69, 0.18);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-link {
  background: none;
  border: none;
  color: var(--brand-navy);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  align-self: flex-start;
}

.status-message {
  min-height: 1.2rem;
  font-size: 0.92rem;
}

.status-message.success {
  color: #1f7a3d;
}

.status-message.error {
  color: var(--brand-rose);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.step-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid rgba(20, 38, 69, 0.08);
  box-shadow: 0 12px 24px rgba(20, 38, 69, 0.05);
}

.step-number {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-sky), var(--brand-rose));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  margin-bottom: 1rem;
}

.testimonial-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.testimonial {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 1.75rem;
  border: 1px solid rgba(20, 38, 69, 0.08);
  box-shadow: 0 18px 32px rgba(20, 38, 69, 0.06);
  position: relative;
}

.testimonial::before {
  content: '“';
  font-size: 4rem;
  position: absolute;
  top: -10px;
  left: 20px;
  color: rgba(198, 67, 72, 0.25);
  font-family: 'Georgia', serif;
}

.testimonial p {
  margin: 0 0 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.testimonial span {
  font-weight: 600;
  color: var(--brand-navy);
}

.reviews-embed {
  margin-top: 2rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(20, 38, 69, 0.12);
  border: 1px solid rgba(20, 38, 69, 0.08);
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.faq-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid rgba(20, 38, 69, 0.08);
  box-shadow: 0 12px 24px rgba(20, 38, 69, 0.05);
}

.faq-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  align-items: start;
}

.contact-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(20, 38, 69, 0.08);
}

.contact-card h3 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
  display: grid;
  gap: 0.75rem;
}

.contact-list li span {
  display: block;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.quick-form {
  display: grid;
  gap: 1rem;
}

.quick-form label {
  font-weight: 600;
}

.quick-form input,
.quick-form textarea {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(20, 38, 69, 0.22);
  padding: 0.75rem 0.9rem;
  font-size: 1rem;
  background: #fff;
}

.quick-form textarea {
  min-height: 120px;
  resize: vertical;
}

.quick-form button {
  justify-self: start;
  padding-inline: 1.6rem;
}

#quickStatus {
  font-size: 0.92rem;
  min-height: 1.2rem;
}

#quickStatus.success {
  color: #1f7a3d;
}

#quickStatus.error {
  color: var(--brand-rose);
}

.site-footer {
  background: var(--brand-navy-dark);
  color: rgba(255, 255, 255, 0.82);
  padding: 2.5rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

.site-footer h4 {
  color: #fff;
  margin-top: 0;
}

.footer-nav,
.footer-contact {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.footer-nav a,
.footer-contact a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}

.footer-nav a:hover,
.footer-contact a:hover,
.footer-nav a:focus,
.footer-contact a:focus {
  text-decoration: underline;
}

.footer-bottom {
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 1rem;
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

.hero-visual {
  position: relative;
}

.hero-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(63, 126, 219, 0.15), rgba(198, 67, 72, 0.18));
  filter: blur(45px);
  z-index: 0;
}

.hero-card {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(20, 38, 69, 0.08);
}

.hero-card h3 {
  margin-top: 0;
}

.hero-card ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0 0;
  display: grid;
  gap: 0.6rem;
  color: var(--text-muted);
}

@media (max-width: 960px) {
  .primary-nav {
    display: none;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-actions {
    justify-content: center;
  }
  .hero-card {
    margin: 0 auto;
  }
  .summary-panel {
    position: static;
  }
  .estimator-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header .inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .header-cta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
  section {
    padding: 3.5rem 0;
  }
  .chat-log {
    max-height: calc(50dvh - 60px);
    padding-bottom: 0.5rem;
  }
  .chat-composer {
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 1.5rem));
    position: sticky;
    bottom: 0;
    background: rgba(249, 251, 255, 0.95);
  }
  .chat-shell {
    min-height: min(95dvh, 900px);
  }
  .estimate-results {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
