:root {
  --bg-dark: #0f1720;
  --bg-overlay: rgba(6, 15, 28, 0.58);
  --text: #0f1720;
  --white: #ffffff;
  --muted: rgba(255, 255, 255, 0.85);
  --card: rgba(255, 255, 255, 0.96);
  --card-border: rgba(255, 255, 255, 0.22);
  --accent: #d49a3a;
  --accent-soft: #e7b965;
  --accent-dark: #b67f28;
  --blue: #2f80ed;
  --blue-dark: #1f6fd8;
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.34);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.22);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --max-width: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  color: var(--white);
  background:
    linear-gradient(var(--bg-overlay), var(--bg-overlay)),
    url("https://images.unsplash.com/photo-1568605114967-8130f3a36994?auto=format&fit=crop&w=1800&q=80")
    center center / cover no-repeat fixed;
}

img,
input,
select,
button,
textarea {
  max-width: 100%;
}

/* Topbar */
.topbar {
  position: relative;
  z-index: 5;
  width: 100%;
  background: rgba(12, 18, 28, 0.58);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  color: #fff;
  font-size: 18px;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.brand-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.2px;
}

.brand-subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
}

.topbar-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.topbar-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(212, 154, 58, 0.16);
  border: 1px solid rgba(231, 185, 101, 0.28);
  color: #ffe3b1;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.topbar-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82);
  text-align: right;
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100vh - 74px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 24px 80px;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center top, rgba(255, 255, 255, 0.04), transparent 38%),
    linear-gradient(180deg, rgba(3, 7, 18, 0.18), rgba(3, 7, 18, 0.34));
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-text {
  text-align: center;
  max-width: 820px;
  margin-bottom: 28px;
}

.mini-kicker {
  display: inline-block;
  margin-bottom: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.main-headline {
  margin: 0;
  font-size: clamp(36px, 4.8vw, 58px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -0.8px;
  text-transform: uppercase;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.subtitle {
  margin: 18px auto 0;
  max-width: 720px;
  font-size: 20px;
  line-height: 1.5;
  color: var(--muted);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.24);
}

/* Card */
.form-card-wrap {
  position: relative;
  width: 100%;
  max-width: 620px;
}

.badge-floating {
  position: absolute;
  top: -18px;
  left: 26px;
  z-index: 3;
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f1c46d 0%, var(--accent) 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 14px 24px rgba(151, 104, 21, 0.28);
}

.form-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: visible;
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-lg);
}

.form-card-topline {
  height: 6px;
  background: linear-gradient(
    90deg,
    var(--accent-soft) 0%,
    var(--accent) 55%,
    var(--accent-dark) 100%
  );
}

.form-card-inner {
  padding: 34px 34px 28px;
  color: var(--text);
}

.form-title {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 800;
  text-align: center;
  color: #16202c;
}

.form-lead {
  margin: 14px auto 24px;
  max-width: 470px;
  text-align: center;
  font-size: 16px;
  line-height: 1.55;
  color: #5d6875;
}

.estimate-form {
  margin: 0;
}

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

.field-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.field-label {
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #1c2734;
}

.field-hint {
  margin-top: 8px;
  font-size: 13px;
  color: #7b8794;
}

.autocomplete-host {
  width: 100%;
  min-width: 0;
}

.autocomplete-host > * {
  width: 100%;
  display: block;
}

/* Optional info box */
.extra-info-box {
  margin-top: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 10px;
}

.extra-title {
  margin: 0 0 5px;
  font-weight: 700;
  font-size: 16px;
  color: #16202c;
}

.extra-text {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.45;
  color: #4b5563;
}

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

.extra-grid > div {
  min-width: 0;
}

.extra-grid label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #1c2734;
}

.extra-grid select,
.extra-grid input,
.email-input {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #d8dee6;
  background: #fff;
  font-size: 16px;
  line-height: 1.2;
  color: #1f2937;
}

.extra-grid select {
  appearance: none;
}

/* Upload */
.upload-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fbf6ea 0%, #f7efdd 100%);
  border: 1px solid #ecdcb8;
  position: relative;
  z-index: 1;
}

.upload-icon {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 154, 58, 0.12);
  color: var(--accent-dark);
  font-size: 22px;
  font-weight: 700;
}

.upload-content {
  flex: 1;
}

.upload-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 800;
  color: #1f2937;
}

.upload-text {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
  color: #6b7280;
}

input[type="file"] {
  width: 100%;
  font-size: 14px;
  color: #1f2937;
}

/* CTA */
.cta-button {
  width: 100%;
  margin-top: 6px;
  padding: 18px 20px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(47, 128, 237, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.cta-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(47, 128, 237, 0.34);
  filter: brightness(1.02);
}

.cta-button:active {
  transform: translateY(0);
}

/* Flash */
.flash-box {
  margin-bottom: 18px;
}

.flash-message {
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff1f1;
  border: 1px solid #f2c7c7;
  color: #a12b2b;
  font-size: 14px;
}

/* Trust row */
.trust-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
  color: rgba(255, 255, 255, 0.92);
}

.trust-item {
  font-size: 14px;
  font-weight: 600;
}

.trust-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
}

/* Google widget */
gmp-place-autocomplete,
#house_address_widget {
  width: 100%;
  display: block;
  position: relative;
  z-index: 60;
}

gmp-place-autocomplete {
  --gmpx-color-surface: #ffffff;
  --gmpx-color-on-surface: #1f2937;
  --gmpx-color-outline: #d8dee6;
  --gmpx-color-primary: #2f80ed;
  --gmpx-font-family-base: Arial, Helvetica, sans-serif;
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

.hero,
.hero-content,
.form-card-wrap,
.form-card,
.form-card-inner,
.form-grid,
.field-group,
.autocomplete-host {
  overflow: visible;
}

.field-group,
.autocomplete-host {
  position: relative;
  z-index: 50;
}

/* Result page */
.result-price {
  font-size: 44px;
  font-weight: 900;
  text-align: center;
  color: #16202c;
  margin-bottom: 10px;
}

.result-range {
  text-align: center;
  font-size: 18px;
  color: #5d6875;
  margin-bottom: 20px;
}

.confidence {
  text-align: center;
  font-size: 14px;
  margin-bottom: 20px;
  color: #374151;
}

.factors {
  margin-top: 20px;
}

.factors h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.factors ul {
  padding-left: 18px;
}

.factors li {
  margin-bottom: 6px;
  font-size: 14px;
}

.muted {
  font-size: 12px;
  color: #6b7280;
  margin-top: 20px;
}

.email-card {
  margin-top: 20px;
}

.upload-box-simple {
  align-items: center;
}

/* Evaluated image */
.evaluated-image-block {
  margin-bottom: 24px;
}

.evaluated-image-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #1c2734;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(212, 154, 58, 0.14);
  color: #9a6820;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.evaluated-image {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 24px rgba(15, 23, 32, 0.08);
}

/* Tablet */
@media (max-width: 900px) {
  .hero {
    padding: 42px 18px 56px;
  }

  .topbar-inner {
    padding: 14px 18px;
  }

  .form-card-inner {
    padding: 28px 22px 22px;
  }

  .form-title {
    font-size: 28px;
  }

  .subtitle {
    font-size: 18px;
  }
}

/* Mobile */
@media (max-width: 640px) {
  body {
    background-attachment: scroll;
  }

  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 14px;
    gap: 12px;
  }

  .topbar-right {
    align-items: flex-start;
  }

  .topbar-text {
    text-align: left;
  }

  .brand-title {
    font-size: 20px;
  }

  .brand-subtitle {
    font-size: 12px;
  }

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

  .hero-content {
    max-width: 100%;
  }

  .hero-text {
    width: 100%;
    margin-bottom: 18px;
  }

  .mini-kicker {
    margin-bottom: 12px;
    padding: 7px 10px;
    font-size: 11px;
  }

  .main-headline {
    font-size: 26px;
    line-height: 1.12;
    letter-spacing: -0.4px;
  }

  .subtitle {
    margin-top: 14px;
    font-size: 15px;
    line-height: 1.45;
  }

  .form-card-wrap {
    width: 100%;
    max-width: 100%;
  }

  .badge-floating {
    left: 14px;
    top: -14px;
    padding: 7px 11px;
    font-size: 12px;
  }

  .form-card {
    border-radius: 16px;
  }

  .form-card-inner {
    padding: 18px 12px 16px;
  }

  .form-title {
    font-size: 22px;
    line-height: 1.2;
  }

  .form-lead {
    font-size: 14px;
    line-height: 1.5;
    margin: 12px auto 18px;
  }

  .field-label {
    font-size: 14px;
  }

  .field-hint {
    font-size: 12px;
    margin-top: 6px;
  }

  .extra-info-box {
    padding: 14px 12px;
    border-radius: 12px;
  }

  .extra-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .extra-grid select,
  .extra-grid input,
  .email-input {
    padding: 12px 12px;
    font-size: 16px;
  }

  .upload-box {
    flex-direction: column;
    padding: 14px;
  }

  .cta-button {
    margin-top: 10px;
    padding: 15px 16px;
    font-size: 16px;
  }

  .trust-row {
    gap: 8px;
    margin-top: 14px;
  }

  .trust-item {
    font-size: 12px;
  }
}

.lead-card {
  margin-top: 20px;
}

.lead-badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(47, 128, 237, 0.12);
  color: #1f6fd8;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.lead-form {
  margin-top: 12px;
}

.lead-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.lead-grid label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #1c2734;
}

.lead-note {
  margin-top: 14px;
}

@media (min-width: 768px) {
  .lead-grid {
    grid-template-columns: 1fr 1fr;
  }

  .lead-grid > div:last-child {
    grid-column: 1 / -1;
  }
}

.result-cta-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0 22px;
}

.secondary-button,
.secondary-button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 15px 16px;
  border-radius: 14px;
  border: 1px solid #d8dee6;
  background: #fff;
  color: #1c2734;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.secondary-button:hover,
.secondary-button-link:hover {
  background: #f8fafc;
}

.lead-card {
  margin-top: 20px;
}

.lead-form {
  margin-top: 12px;
}

.lead-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.lead-grid label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #1c2734;
}

.lead-note {
  margin-top: 14px;
}

.lead-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 14px;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(15, 23, 32, 0.72);
  backdrop-filter: blur(6px);
  -webkit-overflow-scrolling: touch;
}

.lead-modal-overlay.is-hidden {
  display: none;
}

.lead-modal {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: auto 0;
  border-radius: 20px;
  background: #ffffff;
  color: #0f1720;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
  padding: 24px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  overflow-x: hidden;
}

.lead-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 30px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
}

.lead-modal-title {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 800;
  color: #16202c;
}

.lead-modal-text {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.55;
  color: #475569;
}

.lead-modal-note {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.5;
  color: #64748b;
}

.lead-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .lead-modal-overlay {
    padding: 12px;
  }

  .lead-modal {
    padding: 18px 14px;
    border-radius: 16px;
    max-height: calc(100vh - 24px);
  }

  .lead-modal-title {
    font-size: 24px;
  }

  .lead-modal-text {
    font-size: 15px;
  }

  .lead-modal-note {
    font-size: 13px;
  }
}
.lead-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.modal-open {
  overflow: hidden;
}

@media (min-width: 768px) {
  .lead-grid {
    grid-template-columns: 1fr 1fr;
  }

  .lead-grid > div:last-child {
    grid-column: 1 / -1;
  }

  .result-cta-row {
    flex-direction: row;
  }

  .result-cta-row .cta-button,
  .result-cta-row .secondary-button-link {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .lead-modal {
    padding: 20px 16px;
    border-radius: 16px;
  }

  .lead-modal-title {
    font-size: 24px;
  }

  .lead-modal-text {
    font-size: 15px;
  }

  .lead-modal-note {
    font-size: 13px;
  }

  .secondary-button,
  .secondary-button-link {
    font-size: 15px;
    padding: 14px 15px;
  }
}
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 32, 0.72);
  backdrop-filter: blur(6px);
}

.loading-overlay.is-hidden {
  display: none;
}

.loading-card {
  width: 100%;
  max-width: 460px;
  padding: 28px 24px;
  border-radius: 20px;
  background: #ffffff;
  color: #0f1720;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

.loading-spinner {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 5px solid rgba(47, 128, 237, 0.18);
  border-top-color: #2f80ed;
  animation: spin 0.9s linear infinite;
}

.loading-title {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 800;
  color: #16202c;
}

.loading-text {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.5;
  color: #475569;
}

.loading-subtext {
  margin: 0;
  font-size: 14px;
  color: #64748b;
}

.cta-button:disabled {
  cursor: not-allowed;
  opacity: 0.85;
  transform: none;
  filter: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 640px) {
  .loading-card {
    padding: 24px 18px;
    border-radius: 16px;
  }

  .loading-title {
    font-size: 24px;
  }

  .loading-text {
    font-size: 15px;
  }

  .loading-subtext {
    font-size: 13px;
  }
}

.lead-form-message {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.4;
}

.lead-form-message.is-success {
  color: #15803d;
}

.lead-form-message.is-error {
  color: #b91c1c;
}