/* ==========================================================================
   ELEVATED ROOFING PARTNERS — instant-estimate.css
   Google Solar API Satellite Calculator Page Styles
   Remapped to site design tokens (main.css)
   ========================================================================== */

/* --------------------------------------------------------------------------
   PAGE SCOPE — prevents collisions with site's .hero, .eyebrow, etc.
   -------------------------------------------------------------------------- */
.calc-page {
  --calc-red: #C53030;
  --calc-gold-glow: rgba(197, 160, 89, 0.15);
  --calc-gold-faint: rgba(197, 160, 89, 0.06);
}

/* Utility required by JS to toggle sections */
.hidden { display: none !important; }

/* Hide Google's deprecated autocomplete widget — we use our own dropdown */
.pac-container { display: none !important; }

/* --------------------------------------------------------------------------
   HERO SECTION — Dark charcoal with address input
   -------------------------------------------------------------------------- */
.calc-hero {
  background: var(--color-charcoal);
  position: relative;
  overflow: hidden;
  padding: 0;
}

/* Geometric background pattern */
.calc-hero::before {
  content: '';
  position: absolute;
  top: -40%; right: -20%;
  width: 700px; height: 700px;
  background:
    conic-gradient(from 220deg at 50% 50%,
      transparent 0deg,
      rgba(197, 160, 89, 0.04) 60deg,
      transparent 120deg,
      rgba(74, 93, 35, 0.03) 180deg,
      transparent 240deg,
      rgba(197, 160, 89, 0.05) 300deg,
      transparent 360deg
    );
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

/* Bottom gold accent line */
.calc-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
  opacity: 0.3;
  z-index: 3;
}

.calc-hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 420px;
}

.calc-hero__content {
  position: relative;
  z-index: 2;
  padding: calc(var(--nav-height) + var(--space-16)) var(--space-8) var(--space-16);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Staggered entrance animations */
.calc-hero__content > * {
  animation: calcFadeUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) backwards;
}
.calc-hero__content > *:nth-child(1) { animation-delay: 0.1s; }
.calc-hero__content > *:nth-child(2) { animation-delay: 0.2s; }
.calc-hero__content > *:nth-child(3) { animation-delay: 0.3s; }
.calc-hero__content > *:nth-child(4) { animation-delay: 0.4s; }
.calc-hero__content > *:nth-child(5) { animation-delay: 0.55s; }

@keyframes calcFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Eyebrow on dark bg */
.calc-hero .calc-eyebrow {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-gold);
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.calc-hero .calc-eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--color-gold);
  flex-shrink: 0;
}

.calc-hero h1 {
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-size: var(--text-5xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: var(--space-5);
  max-width: 560px;
}

.calc-hero h1 em {
  font-style: normal;
  color: var(--color-gold);
}

.calc-hero .calc-subtitle {
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font-body);
  font-size: var(--text-base);
  max-width: 460px;
  margin-bottom: var(--space-10);
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   ADDRESS FORM
   -------------------------------------------------------------------------- */
.address-form-wrap {
  position: relative;
  max-width: 540px;
}

.address-form {
  display: flex;
  gap: 0;
  max-width: 540px;
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.3s;
}

.address-form:focus-within {
  border-color: var(--color-gold);
  background: rgba(255, 255, 255, 0.08);
}

.address-input-wrap {
  flex: 1;
  position: relative;
}

.address-input {
  width: 100%;
  height: 56px;
  padding: 0 var(--space-4) 0 48px;
  border: none;
  background: transparent;
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: var(--text-base);
  outline: none;
}

.address-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.address-icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-gold);
  pointer-events: none;
  opacity: 0.6;
}

.btn-estimate {
  height: 56px;
  padding: 0 var(--space-8);
  background: var(--color-gold);
  color: var(--color-charcoal);
  border: none;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  flex-shrink: 0;
}

.btn-estimate:hover { background: var(--color-gold-hover); }
.btn-estimate:active { background: var(--color-gold-hover); }
.btn-estimate:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   TRUST STRIP
   -------------------------------------------------------------------------- */
.trust-strip {
  display: flex;
  gap: var(--space-8);
  margin-top: var(--space-10);
  padding-top: var(--space-8);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: rgba(255, 255, 255, 0.35);
  font-family: var(--font-heading);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.trust-item svg {
  color: var(--color-gold);
  opacity: 0.5;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   AUTOCOMPLETE DROPDOWN
   -------------------------------------------------------------------------- */
.autocomplete-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  overflow: hidden;
}

.autocomplete-item {
  padding: 13px var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  cursor: pointer;
  color: var(--color-text-primary);
  border-top: 1px solid var(--color-border);
  transition: background 0.12s;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.autocomplete-item:first-child { border-top: none; }
.autocomplete-item:hover { background: var(--color-bg-alt); }

.autocomplete-item svg {
  color: var(--color-gold);
  flex-shrink: 0;
  opacity: 0.6;
}

.autocomplete-main {
  font-weight: 600;
  color: var(--color-text-primary);
}

.autocomplete-secondary {
  color: var(--color-text-muted);
  font-weight: 400;
}

.autocomplete-powered {
  padding: var(--space-2) var(--space-4);
  font-size: 0.625rem;
  color: var(--color-warmgray);
  text-align: right;
  border-top: 1px solid var(--color-border);
  font-family: var(--font-heading);
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   LOADING SECTION
   -------------------------------------------------------------------------- */
.calc-loading {
  padding: var(--space-24) 0;
  text-align: center;
  background: var(--color-bg-alt);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation: calcSpin 0.75s linear infinite;
  margin: 0 auto var(--space-6);
}

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

.loading-text {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   RESULTS SECTION
   -------------------------------------------------------------------------- */
.calc-results-section {
  padding: var(--space-16) 0 var(--space-12);
  background: var(--color-bg-alt);
  position: relative;
}

.results-header {
  margin-bottom: var(--space-10);
}

.results-header .calc-eyebrow {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-olive);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.results-header .calc-eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--color-olive);
  flex-shrink: 0;
}

.results-header h2 {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
}

.results-header p {
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: var(--text-sm);
}

/* Imagery grid — satellite map + street view side by side */
.results-imagery {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.map-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}

.map-container {
  width: 100%;
  height: 300px;
  background: var(--color-bg-alt);
}

/* Street View card */
.streetview-card { position: relative; }

.streetview-img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
  background: var(--color-bg-alt);
}

/* Roof data card */
.roof-data-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.estimate-details {
  padding: var(--space-1) var(--space-8) var(--space-8);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) 0;
}

.detail-row + .detail-row {
  border-top: 1px solid var(--color-border);
}

.detail-label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.detail-value {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text-primary);
}

.disclaimer {
  margin: 0 var(--space-8) var(--space-6);
  padding: var(--space-4) var(--space-4);
  background: var(--calc-gold-faint);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.6;
  border-left: 2px solid var(--color-gold);
}

/* --------------------------------------------------------------------------
   LEAD FORM SECTION
   -------------------------------------------------------------------------- */
.calc-form-section {
  padding: var(--space-16) 0 var(--space-20);
  background: var(--color-bg);
  position: relative;
}

.calc-form-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--color-border);
}

.form-card {
  max-width: 480px;
  margin: 0 auto;
}

.form-card h3 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text-primary);
  text-align: center;
  margin-bottom: var(--space-2);
  letter-spacing: -0.01em;
}

.form-card .form-subtitle {
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  text-align: center;
  margin-bottom: var(--space-8);
}

.form-group {
  margin-bottom: var(--space-5);
}

.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.form-group input {
  width: 100%;
  height: 50px;
  padding: 0 var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-primary);
  outline: none;
  background: var(--color-bg);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.form-group input:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px var(--calc-gold-glow);
}

.form-group input.error {
  border-color: var(--calc-red);
  box-shadow: 0 0 0 3px rgba(197, 48, 48, 0.1);
}

.form-group input::placeholder {
  color: var(--color-warmgray);
}

.form-error {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  color: var(--calc-red);
  margin-top: var(--space-2);
  display: none;
  font-weight: 500;
}

.btn-submit {
  width: 100%;
  height: 54px;
  margin-top: var(--space-3);
  background: var(--color-charcoal);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  position: relative;
  overflow: hidden;
}

.btn-submit::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-gold), var(--color-gold-hover));
}

.btn-submit:hover { background: rgba(21, 21, 23, 0.85); }
.btn-submit:active { transform: scale(0.99); }

/* Side-by-side form fields */
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

/* --------------------------------------------------------------------------
   THANK YOU SECTION
   -------------------------------------------------------------------------- */
.calc-thankyou {
  padding: var(--space-24) 0;
  text-align: center;
  background: var(--color-bg-alt);
}

.thankyou-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--color-olive);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
}

.calc-thankyou h2 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
  font-weight: 700;
}

.calc-thankyou p {
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: var(--text-base);
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   ERROR SECTION
   -------------------------------------------------------------------------- */
.calc-error {
  padding: var(--space-20) 0;
  text-align: center;
  background: var(--color-bg-alt);
}

.error-card {
  max-width: 440px;
  margin: 0 auto;
  padding: var(--space-10) var(--space-10);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.error-card h3 {
  font-family: var(--font-heading);
  color: var(--color-text-primary);
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.error-card p {
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  margin-bottom: var(--space-8);
  line-height: 1.7;
}

.btn-retry {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  background: var(--color-charcoal);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-retry:hover { background: rgba(21, 21, 23, 0.85); }

/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  .calc-hero__content {
    padding: calc(var(--nav-height) + var(--space-20)) var(--space-8) var(--space-20);
  }

  .results-imagery {
    grid-template-columns: 1fr 1fr;
  }

  .map-container { height: 420px; }
  .streetview-img { height: 420px; }

  .form-row {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
  }

  .form-card { max-width: 560px; }

  .trust-strip { gap: var(--space-10); }
}

@media (min-width: 1024px) {
  .calc-hero h1 { font-size: var(--text-6xl); }
}

@media (max-width: 600px) {
  .address-form {
    flex-direction: column;
    border-radius: var(--radius-md);
  }

  .btn-estimate {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .trust-strip {
    flex-wrap: wrap;
    gap: var(--space-4) var(--space-6);
  }

  .calc-hero h1 { font-size: var(--text-3xl); }

  .calc-hero__content {
    padding: calc(var(--nav-height-mobile) + var(--space-12)) var(--space-6) var(--space-12);
  }
}

@media (max-width: 479px) {
  .calc-hero h1 { font-size: var(--text-2xl); }

  .estimate-details { padding: var(--space-1) var(--space-5) var(--space-5); }
  .disclaimer { margin: 0 var(--space-5) var(--space-5); }
}
