/* Marketing-site overrides + additions on top of tokens.css + site.css */

/* ============ HERO — real photo replaces CSS render ============ */
.cg-hero { padding-top: 0; }
.cg-hero-inner {
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  padding-top: 72px;
  padding-bottom: 96px;
}
.cg-hero-photo {
  position: relative;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4 / 5;
  background: var(--ink-100);
}
.cg-hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cg-hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(15,22,32,0.18) 100%);
  pointer-events: none;
}
.cg-hero-photo-badge {
  position: absolute;
  bottom: 20px; left: 20px;
  background: rgba(15,22,32,0.78);
  backdrop-filter: blur(8px);
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cg-hero-photo-badge svg { width: 16px; height: 16px; color: var(--cg-sun-500); }

/* ============ HERO CTAs (when address form is removed) ============ */
.cg-hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

/* ============ CONTACT SECTION (GHL form embed) ============ */
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
.cg-contact-inner {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 56px;
  align-items: flex-start;
}
.cg-contact-copy { padding-top: 8px; }
.cg-contact-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 12px;
}
.cg-contact-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink-700);
}
.cg-contact-list svg {
  width: 18px; height: 18px;
  color: var(--cg-green-700);
  flex-shrink: 0;
}
.cg-contact-list a {
  color: var(--cg-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cg-contact-form {
  /* GHL form renders inside an iframe — we just style its container. */
  width: 100%;
}
@media (max-width: 900px) {
  .cg-contact-inner { grid-template-columns: 1fr; gap: 32px; }
}

/* ============ LEGAL PAGES ============ */
.cg-legal {
  background: var(--canvas);
  min-height: 100vh;
}
.cg-legal-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 32px 96px;
  font-family: var(--font-body);
  color: var(--ink-800);
  line-height: 1.65;
}
.cg-legal-content h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(32px, 4vw, 48px);
  letter-spacing: -0.02em;
  color: var(--ink-900);
  margin: 0 0 8px;
}
.cg-legal-content h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink-900);
  margin: 32px 0 8px;
}
.cg-legal-content p { margin: 0 0 14px; }
.cg-legal-content ul { padding-left: 20px; margin: 0 0 14px; }
.cg-legal-content li { margin-bottom: 6px; }
.cg-legal-content .cg-legal-meta {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--fg-3);
  margin-bottom: 32px;
}

/* ============ ESTIMATE PAGE ============ */
.cg-estimate-page {
  background: var(--canvas);
  min-height: 100vh;
}
.cg-estimate-hero {
  padding: 56px 0 32px;
  text-align: center;
}
.cg-estimate-hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 16px 0 14px;
  color: var(--ink-900);
}
.cg-estimate-hero p {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--ink-600);
  max-width: 600px;
  margin: 0 auto;
}

.cg-step-indicator {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 36px 0 40px;
}
.cg-step-dot {
  width: 36px; height: 4px;
  background: var(--ink-200);
  border-radius: 999px;
  transition: background 200ms var(--ease-out);
}
.cg-step-dot.is-active { background: var(--cg-blue); }
.cg-step-dot.is-done { background: var(--cg-green); }

.cg-estimate-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 40px;
  max-width: 640px;
  margin: 0 auto 80px;
}
@media (max-width: 600px) {
  .cg-estimate-card { padding: 24px; }
}

.cg-address-input {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 2px solid var(--ink-200);
  border-radius: 14px;
  padding: 4px 16px;
  margin-bottom: 16px;
  transition: border-color 150ms, box-shadow 150ms;
  position: relative;
}
.cg-address-input:focus-within {
  border-color: var(--cg-blue);
  box-shadow: 0 0 0 4px rgba(45,94,142,0.12);
}
.cg-address-input svg { width: 20px; height: 20px; color: var(--fg-3); flex-shrink: 0; }
.cg-address-input input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font: 16px var(--font-body);
  padding: 16px 0;
  color: var(--ink-900);
}

.cg-suggestions {
  position: absolute;
  top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-cool);
  z-index: 10;
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
}
.cg-suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink-800);
  border-bottom: 1px solid var(--ink-100);
}
.cg-suggestion-item:last-child { border-bottom: 0; }
.cg-suggestion-item:hover,
.cg-suggestion-item.is-highlighted { background: var(--ink-50); }
.cg-suggestion-item svg { width: 16px; height: 16px; color: var(--fg-3); flex-shrink: 0; }
.cg-suggestion-main { font-weight: 500; color: var(--ink-900); }
.cg-suggestion-sub { color: var(--fg-3); font-size: 13px; }

.cg-btn-full {
  width: 100%;
  justify-content: center;
  padding: 16px 22px;
  font-size: 16px;
}
.cg-btn-disabled { opacity: 0.5; pointer-events: none; }

.cg-form-grid { display: grid; gap: 16px; }
.cg-field { display: flex; flex-direction: column; gap: 6px; }
.cg-field label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-700);
}
.cg-field input,
.cg-field select,
.cg-field textarea {
  font: 16px var(--font-body);
  border: 2px solid var(--ink-200);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--ink-900);
  transition: border-color 150ms, box-shadow 150ms;
}
.cg-field input:focus,
.cg-field select:focus,
.cg-field textarea:focus {
  border-color: var(--cg-blue);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(45,94,142,0.12);
}
.cg-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 480px) { .cg-field-row { grid-template-columns: 1fr; } }
.cg-field small {
  font-size: 12px;
  color: var(--fg-3);
}

.cg-fineprint {
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.5;
  color: var(--fg-3);
  margin-top: 20px;
  text-align: center;
}
.cg-fineprint a { color: var(--cg-blue); text-decoration: underline; }

/* ============ SOLAR REPORT ============ */
.cg-report-hero {
  padding: 40px 0 24px;
}
.cg-report-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  color: var(--ink-600);
  text-decoration: none;
  margin-bottom: 24px;
}
.cg-report-back:hover { color: var(--cg-blue); }
.cg-report-back svg { width: 16px; height: 16px; }

.cg-report-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink-900);
  margin: 0 0 8px;
}
.cg-report-address {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink-600);
  display: flex;
  align-items: center;
  gap: 8px;
}
.cg-report-address svg { width: 16px; height: 16px; color: var(--cg-sun-700); }

.cg-report-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  margin: 32px 0;
}
@media (max-width: 900px) { .cg-report-grid { grid-template-columns: 1fr; } }

.cg-satellite-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
}
.cg-satellite-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--ink-100);
  position: relative;
  overflow: hidden;
}
.cg-satellite-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.cg-satellite-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.cg-satellite-caption {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--border-cool);
}
.cg-satellite-caption-lbl {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fg-3);
}
.cg-satellite-caption-stat {
  display: flex;
  gap: 24px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-900);
}
.cg-satellite-caption-stat span { color: var(--fg-3); font-weight: 500; margin-left: 4px; }

.cg-headline-card {
  background: var(--ink-900);
  color: white;
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-glow-sun);
  position: relative;
  overflow: hidden;
}
.cg-headline-card::before {
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(216,139,63,0.4) 0%, transparent 70%);
  pointer-events: none;
}
.cg-headline-eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--cg-sun-500);
}
.cg-headline-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(48px, 6vw, 72px);
  line-height: 1;
  letter-spacing: -0.025em;
  margin: 12px 0 8px;
  position: relative;
}
.cg-headline-sub {
  font-family: var(--font-body);
  font-size: 15px;
  color: rgba(255,255,255,0.72);
  margin: 0;
  position: relative;
}

.cg-stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 32px 0;
}
@media (max-width: 720px) { .cg-stat-row { grid-template-columns: repeat(2, 1fr); } }

.cg-stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
}
.cg-stat-card-eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--fg-3);
}
.cg-stat-card-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink-900);
  margin: 8px 0 0;
}
.cg-stat-card-num span { font-size: 16px; color: var(--fg-3); margin-left: 4px; font-weight: 600; }
.cg-stat-card-sub {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fg-3);
  margin-top: 4px;
}

.cg-disclaimer {
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.55;
  color: var(--fg-3);
  background: var(--ink-50);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin: 16px 0 32px;
}

/* ============ LOADING ============ */
.cg-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 24px;
  text-align: center;
}
.cg-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--ink-200);
  border-top-color: var(--cg-blue);
  border-radius: 50%;
  animation: cg-spin 800ms linear infinite;
}
@keyframes cg-spin { to { transform: rotate(360deg); } }
.cg-loading-msg {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink-800);
}
.cg-loading-sub {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--fg-3);
}

/* ============ ERROR ============ */
.cg-error-box {
  background: var(--danger-bg);
  border: 1px solid rgba(194,54,43,0.2);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--danger);
  margin: 0 0 20px;
}

/* ============ SUCCESS ============ */
.cg-success {
  text-align: center;
  padding: 24px 0;
}
.cg-success-ico {
  width: 64px; height: 64px;
  border-radius: 999px;
  background: var(--cg-green-50);
  color: var(--cg-green-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.cg-success-ico svg { width: 32px; height: 32px; }
.cg-success h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.01em;
  color: var(--ink-900);
  margin: 0 0 8px;
}
.cg-success p {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink-600);
  margin: 0 0 24px;
}

/* ============ RESPONSIVE — landing page ============ */
@media (max-width: 900px) {
  .cg-hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 40px;
    padding-bottom: 64px;
  }
  .cg-hero-photo { aspect-ratio: 4 / 3; }
  .cg-section { padding: 64px 0; }
  .cg-steps { grid-template-columns: 1fr; }
  .cg-stats { grid-template-columns: 1fr; gap: 32px; }
  .cg-nav { display: none; }
}

@media (max-width: 600px) {
  .cg-container { padding: 0 20px; }
  .cg-hero-form { flex-direction: column; }
  .cg-cta-inner { flex-direction: column; align-items: flex-start; }
  .cg-footer-inner { grid-template-columns: 1fr; }
  .cg-footer-cols { grid-template-columns: repeat(2, 1fr); }
}
