/* ===== HouseBase Landing Page — Custom Styles ===== */

/* Smooth scrolling */
html { scroll-behavior: smooth; }

/* Hero gradient mesh */
.hero-gradient {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #312e81 70%, #0f172a 100%);
}
.hero-mesh {
  background-image:
    radial-gradient(at 20% 30%, rgba(99, 102, 241, 0.3) 0, transparent 50%),
    radial-gradient(at 80% 20%, rgba(139, 92, 246, 0.25) 0, transparent 50%),
    radial-gradient(at 60% 80%, rgba(79, 70, 229, 0.2) 0, transparent 50%),
    radial-gradient(at 10% 90%, rgba(59, 130, 246, 0.15) 0, transparent 50%);
}

/* Glassmorphism form card */
.form-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Form inputs */
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.75rem;
  font-size: 0.938rem;
  color: #1e293b;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.form-input::placeholder { color: #94a3b8; }

.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.75rem;
  font-size: 0.938rem;
  color: #1e293b;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  appearance: auto;
}
.form-select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Form buttons */
.btn-primary {
  width: 100%;
  padding: 0.875rem;
  border: none;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  background: #f59e0b;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}
.btn-primary:hover {
  background: #d97706;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  padding: 0.75rem 1.5rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

/* Progress bar */
.progress-bar {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* Estimate display */
.estimate-value {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Consent label */
.consent-label {
  font-size: 0.75rem;
  line-height: 1.4;
  color: #64748b;
}
.consent-label a { color: #6366f1; text-decoration: underline; }

/* Error message */
.form-error {
  color: #dc2626;
  font-size: 0.813rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #fef2f2;
  border-radius: 0.5rem;
  border: 1px solid #fecaca;
}

/* ===== Scroll-driven reveal animations ===== */
.reveal-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: var(--delay, 0s);
}
.reveal-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* CSS Scroll-driven animations (progressive enhancement) */
@supports (animation-timeline: view()) {
  .reveal-up {
    opacity: 0;
    transform: translateY(30px);
    animation: reveal-up-anim linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
    transition: none;
  }
  .reveal-up.visible { /* override not needed with scroll animation */ }

  @keyframes reveal-up-anim {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* Counter animation */
.counter { font-variant-numeric: tabular-nums; }

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .reveal-up { opacity: 1; transform: none; transition: none; animation: none; }
  html { scroll-behavior: auto; }
  .btn-primary:hover, .btn-secondary:hover { transform: none; }
  #scroll-progress { display: none; }
}

/* ===== Dark mode ===== */
@media (prefers-color-scheme: dark) {
  /* Landing page is already mostly dark-themed, minimal changes needed */
  .form-card { background: rgba(30, 41, 59, 0.95); border-color: rgba(255,255,255,0.1); }
  .form-input, .form-select { background: #0f172a; border-color: #334155; color: #f1f5f9; }
  .form-input:focus, .form-select:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,0.2); }
  .consent-label { color: #94a3b8; }
}

/* ===== Address Autocomplete ===== */
.ac-wrap { position: relative; }
.ac-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  margin-top: 4px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  max-height: 220px;
  overflow-y: auto;
}
.ac-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: #1e293b;
  background: none;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.15s;
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover { background: #f1f5f9; }
@media (prefers-color-scheme: dark) {
  .ac-dropdown { background: #1e293b; border-color: #334155; }
  .ac-item { color: #f1f5f9; border-color: #334155; }
  .ac-item:hover { background: #334155; }
}

/* ===== Offer Page ===== */
.option-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.option-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.distress-banner {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
}

@media (prefers-color-scheme: dark) {
  .option-card { background: #1e293b; border-color: #334155; }
  .option-card:hover { border-color: #6366f1; }
}

/* ===== Honeypot ===== */
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

/* ===== Cookie Consent Banner ===== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 0 1rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.cookie-banner.visible { transform: translateY(0); }
.cookie-banner-inner {
  max-width: 56rem;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
}
.cookie-text {
  flex: 1;
  font-size: 0.813rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
}
.cookie-link { color: #818cf8; text-decoration: underline; }
.cookie-link:hover { color: #a5b4fc; }
.cookie-buttons { display: flex; gap: 0.5rem; flex-shrink: 0; }
.cookie-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.813rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.cookie-btn-accept {
  background: #f59e0b;
  color: #0f172a;
}
.cookie-btn-accept:hover { background: #d97706; }
.cookie-btn-decline {
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.cookie-btn-decline:hover { color: #fff; border-color: rgba(255, 255, 255, 0.4); }
@media (max-width: 640px) {
  .cookie-banner-inner { flex-direction: column; text-align: center; }
  .cookie-buttons { width: 100%; }
  .cookie-btn { flex: 1; }
}

/* ---- Parallax flares (main landing) ---- */
.landing-flares {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.landing-flare {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
  filter: blur(60px);
}
.landing-flare--1 {
  width: 600px;
  height: 600px;
  top: -150px;
  right: -120px;
  background: rgba(99, 102, 241, 0.10);
}
.landing-flare--2 {
  width: 400px;
  height: 400px;
  top: 35%;
  left: -120px;
  background: rgba(139, 92, 246, 0.08);
}
.landing-flare--3 {
  width: 320px;
  height: 320px;
  top: 65%;
  right: 5%;
  background: rgba(245, 158, 11, 0.06);
}
.landing-flare--4 {
  width: 450px;
  height: 450px;
  top: 100%;
  left: 20%;
  background: rgba(99, 102, 241, 0.07);
}
@media (prefers-reduced-motion: reduce) {
  .landing-flares { display: none; }
}
