/* CVHS Estimate Form — warm neutrals + accent */
:root {
  --accent: #c56e21;
  --accent-hover: #a85a18;
  --accent-soft: #f5e6d8;
  --bg: #f7f3ef;
  --card: #ffffff;
  --text: #2c2419;
  --muted: #6b5e52;
  --border: #e0d5c8;
  --error: #b33a3a;
  --success: #2d6a4f;
  --radius: 10px;
  --shadow: 0 4px 20px rgba(44, 36, 25, 0.08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

.page {
  max-width: 520px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.logo {
  display: block;
  max-height: 64px;
  max-width: 200px;
  margin: 0 auto 0.75rem;
  object-fit: contain;
}

.header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text);
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 1.5rem 1.35rem 1.75rem;
}

.progress {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.25s ease;
}

.step-indicator {
  margin: 0 0 1.25rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: right;
}

.step-container {
  min-height: 140px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field-group label {
  font-weight: 600;
  font-size: 0.95rem;
}

.field-group .hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.field-group input[type="text"],
.field-group input[type="email"],
.field-group input[type="tel"],
.field-group input[type="file"],
.field-group textarea,
.field-group select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  font: inherit;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field-group input:focus,
.field-group textarea:focus,
.field-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-group textarea {
  min-height: 120px;
  resize: vertical;
}

.field-group .error-text {
  margin: 0;
  font-size: 0.85rem;
  color: var(--error);
}

.field-group.has-error input,
.field-group.has-error textarea {
  border-color: var(--error);
}

/* Choice buttons (Yes/No, customer type) */
.choice-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.choice-btn {
  display: block;
  width: 100%;
  padding: 0.9rem 1rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  color: var(--text);
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.choice-btn:hover,
.choice-btn:focus {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.choice-btn.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.file-list {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
  color: var(--muted);
}

.file-list li {
  padding: 0.2rem 0;
}

.recaptcha-wrap {
  display: flex;
  justify-content: center;
  min-height: 78px;
}

.nav-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

.btn {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.7rem 1.25rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg);
  color: var(--text);
}

.success-panel {
  text-align: center;
  padding: 1rem 0;
}

.success-panel h2 {
  margin: 0 0 0.5rem;
  color: var(--success);
}

.success-panel p {
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.error-panel {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #fdecea;
  border: 1px solid #f5c6c2;
  border-radius: 8px;
  color: var(--error);
  font-size: 0.9rem;
}

.error-panel p {
  margin: 0;
}

/* Honeypot — visually hidden, not display:none (bots often skip display:none) */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.footer p {
  margin: 0;
}

/* Google Places pac dropdown above card */
.pac-container {
  z-index: 10000;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-family: var(--font);
}

@media (max-width: 480px) {
  .page {
    padding: 1rem 0.75rem 2rem;
  }

  .card {
    padding: 1.25rem 1rem 1.5rem;
  }

  .nav-buttons {
    flex-wrap: wrap;
  }

  .nav-buttons .btn {
    flex: 1 1 auto;
  }
}

/* Google Places Autocomplete (New) widget */
.places-autocomplete,
gmp-place-autocomplete {
  display: block;
  width: 100%;
}

/* Places (New) suggestion list under Address Line 1 */
.places-suggestions {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  max-height: 220px;
  overflow-y: auto;
  z-index: 5;
}
.places-suggestions li {
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.places-suggestions li:last-child {
  border-bottom: none;
}
.places-suggestions li:hover,
.places-suggestions li:focus {
  background: var(--accent-soft);
  outline: none;
}


/* —— Embedded in specialty site iframe —— */
body.embed {
  min-height: 0;
  background: var(--white);
}
body.embed .page {
  max-width: none;
  padding: 0.35rem 0.6rem 0.4rem;
}
body.embed .header {
  margin-bottom: 0.4rem;
}
body.embed .header h1 {
  font-size: 1.2rem;
  margin: 0;
}
body.embed .logo,
body.embed .subtitle,
body.embed .footer {
  display: none !important;
}
body.embed .card {
  box-shadow: none;
  border: none;
  border-radius: 0;
  padding: 0.15rem 0 0.25rem;
}
body.embed .step-container {
  min-height: 0;
}
body.embed .nav-buttons {
  margin-top: 0.85rem;
}

/* compact embed spacing */
body.embed .progress { margin-bottom: 0.45rem; }
body.embed .step-indicator { margin: 0 0 0.55rem; }
body.embed .field-group { gap: 0.35rem; }
body.embed .field-group textarea { min-height: 84px; }
body.embed .nav-buttons { margin-top: 0.6rem; }

/* Call/email fallback links */
.error-panel a,
.error-text a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  white-space: nowrap;
}

/* Keep the empty logo slot hidden when no logoUrl is configured */
.logo[hidden] { display: none; }
