/*
 * EverHome Quote Widget — Styles
 * Designed to match the existing site form aesthetic:
 * White card · rounded corners · light-gray inputs · green CTA · Roboto font
 *
 * ── Class map ────────────────────────────────────────────────────────────────
 *   .everhome-quote-widget   — Outer container
 *   .ehq-card                — White form card
 *   .ehq-header              — Heading block (eyebrow / heading / sub)
 *   .ehq-eyebrow             — Small uppercase label
 *   .ehq-heading             — Main heading ("Get a Quote Today")
 *   .ehq-subheading          — Subheading paragraph
 *   .ehq-progress-wrap       — Progress bar container
 *   .ehq-progress            — Flex row of dots and lines
 *   .ehq-dot                 — Step dot
 *   .ehq-dot--on             — Active dot
 *   .ehq-dot--done           — Completed dot (✓)
 *   .ehq-line                — Connector line
 *   .ehq-line--done          — Completed line
 *   .ehq-steps-wrap          — All step panels container
 *   .ehq-step                — A single step (hidden)
 *   .ehq-step--active        — Visible step
 *   .ehq-step-q              — Question heading
 *   .ehq-step-sub            — Question sub-copy
 *   .ehq-opts                — Options list
 *   .ehq-opts--grid          — Options 2-col grid
 *   .ehq-btn                 — Option button
 *   .ehq-btn--sel            — Selected option
 *   .ehq-btn--highlight      — Highlighted option
 *   .ehq-fg                  — Input form group
 *   .ehq-input               — Text / tel input
 *   .ehq-submit-btn          — Submit CTA button
 *   .ehq-financing           — Financing badge
 *   .ehq-trust               — Star trust line
 *   .ehq-back-btn            — ← Back button
 *   .ehq-success             — Success screen
 *   .ehq-success-icon        — Green checkmark circle
 *   .ehq-success-ttl         — Success heading
 *   .ehq-success-sub         — Success subtext
 *   .ehq-summary             — Lead summary box
 *   .ehq-summary-ttl         — Summary label
 *   .ehq-summary-row         — Key/value row
 *   .ehq-sum-k               — Summary key
 *   .ehq-sum-v               — Summary value
 *   .ehq-modal-trigger       — Trigger button (modal mode)
 *   .ehq-modal-overlay       — Full-screen overlay
 *   .ehq-modal-overlay--open — Overlay open state
 *   .ehq-modal-dialog        — Modal box
 *   .ehq-modal-close         — ✕ close button
 * ─────────────────────────────────────────────────────────────────────────────
 */

/* ── Design tokens ───────────────────────────────────────────────────────── */
.everhome-quote-widget {
  /* Primary green — exact match to site submit button #448c5d */
  --ehq-green:        #448c5d;
  --ehq-green-dark:   #2d6b3f;
  --ehq-green-light:  #edf7ed;

  /* Neutrals — matches site body / input palette */
  --ehq-dark:         #1a1a1a;
  --ehq-body:         #707173;
  --ehq-slate:        #6b8f9e;
  --ehq-border:       #e8e8e8;
  --ehq-input-bg:     #ededed;   /* matches site .form-control background */
  --ehq-card-bg:      #ffffff;
  --ehq-page-bg:      #f5f5f5;

  /* Typography — matches site Roboto stack */
  --ehq-font:         'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing & shape — matches site card exactly */
  --ehq-radius-sm:    5px;    /* input/button radius matches site */
  --ehq-radius-md:    10px;
  --ehq-radius-lg:    12px;   /* card radius matches site */
  --ehq-shadow:       0 15px 35px rgba(0, 0, 0, 0.10);  /* site card shadow */
  --ehq-transition:   0.18s ease;

  /* Icon circle — the green edit circle at top of card */
  --ehq-icon-size:    60px;
}

/* ── Outer wrapper ────────────────────────────────────────────────────────── */
.everhome-quote-widget {
  width: 100%;
  font-family: var(--ehq-font);
  box-sizing: border-box;
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.ehq-card {
  width: 100%;
  background: var(--ehq-card-bg);
  border-radius: var(--ehq-radius-lg);
  box-shadow: var(--ehq-shadow);
  padding: 50px 40px 36px;  /* extra top padding for the icon overlap */
  box-sizing: border-box;
  font-family: var(--ehq-font);
  position: relative;
  margin-top: calc(var(--ehq-icon-size) / 2); /* pushes card down so icon sits on top edge */
}

/* Green circle icon at top-center — matches site .elementor-icon-wrapper circle */
.ehq-card::before {
  content: '';
  position: absolute;
  top: calc(var(--ehq-icon-size) / -2);
  left: 50%;
  transform: translateX(-50%);
  width: var(--ehq-icon-size);
  height: var(--ehq-icon-size);
  border-radius: 50%;
  background: var(--ehq-green);
  /* edit/pencil icon as inline SVG background */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 26px 26px;
  background-color: var(--ehq-green);
  z-index: 1;
}

/* ── Bare / Form-Only mode ────────────────────────────────────────────────── */
/* No card, no icon, no heading — fields sit directly inside the Elementor column */
.ehq-bare-wrap {
  width: 100%;
  font-family: var(--ehq-font);
  box-sizing: border-box;
}
.ehq-bare-wrap .ehq-steps-wrap { overflow: visible; }
.ehq-bare-wrap .ehq-input      { padding: 16px 20px; font-size: 16px; border-radius: 4px; }
.ehq-bare-wrap .ehq-submit-btn { border-radius: 4px; letter-spacing: 1px; font-size: 15px; padding: 18px 24px; }
.ehq-bare-wrap .ehq-btn        { border-radius: 4px; }


.ehq-header {
  text-align: center;
  margin-bottom: 28px;
}

.ehq-eyebrow {
  display: none; /* hidden by default to match screenshot style; enable via CSS if needed */
}

.ehq-heading {
  font-family: var(--ehq-font);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ehq-dark);
  margin: 0 0 10px;
  letter-spacing: -0.3px;
}

.ehq-subheading {
  font-size: 15px;
  font-weight: 400;
  color: var(--ehq-slate);
  line-height: 1.6;
  margin: 0;
}

/* ── Progress bar ─────────────────────────────────────────────────────────── */
.ehq-progress-wrap {
  margin-bottom: 24px;
}

.ehq-progress {
  display: flex;
  align-items: center;
  gap: 0;
}

.ehq-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--ehq-border);
  color: var(--ehq-body);
  transition: background var(--ehq-transition), color var(--ehq-transition);
  font-family: var(--ehq-font);
}

.ehq-dot--on {
  background: var(--ehq-green);
  color: #fff;
}

.ehq-dot--done {
  background: var(--ehq-green-dark);
  color: #fff;
}

.ehq-line {
  flex: 1;
  height: 2px;
  background: var(--ehq-border);
  transition: background var(--ehq-transition);
}

.ehq-line--done {
  background: var(--ehq-green);
}

/* ── Steps & Animations ─────────────────────────────────────────────────── */
.ehq-steps-wrap {
  position: relative;
  overflow: hidden;
}

.ehq-step {
  display: none;
}

.ehq-step--active {
  display: block;
}

/* Forward: enter from right */
@keyframes ehqSlideInRight {
  from { opacity: 0; transform: translateX(36px); }
  to   { opacity: 1; transform: translateX(0); }
}
/* Forward: exit to left */
@keyframes ehqSlideOutLeft {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-36px); }
}
/* Back: enter from left */
@keyframes ehqSlideInLeft {
  from { opacity: 0; transform: translateX(-36px); }
  to   { opacity: 1; transform: translateX(0); }
}
/* Back: exit to right */
@keyframes ehqSlideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(36px); }
}

.ehq-slide-enter-right { animation: ehqSlideInRight  0.3s cubic-bezier(0.25,0.46,0.45,0.94) both; }
.ehq-slide-exit-left   { animation: ehqSlideOutLeft  0.25s cubic-bezier(0.55,0,1,0.45) both; position: absolute; top: 0; left: 0; width: 100%; }
.ehq-slide-enter-left  { animation: ehqSlideInLeft   0.3s cubic-bezier(0.25,0.46,0.45,0.94) both; }
.ehq-slide-exit-right  { animation: ehqSlideOutRight 0.25s cubic-bezier(0.55,0,1,0.45) both; position: absolute; top: 0; left: 0; width: 100%; }

.ehq-step-q {
  font-family: var(--ehq-font);
  font-size: 18px;
  font-weight: 700;
  color: var(--ehq-dark);
  margin: 0 0 4px;
  line-height: 1.3;
}

.ehq-step-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ehq-green);
  margin-bottom: 6px;
  font-family: var(--ehq-font);
}

.ehq-step-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--ehq-slate);
  margin: 0 0 14px;
  line-height: 1.5;
}

/* ── Option group (home page step 2) ─────────────────────────────── */
.ehq-opt-group {
  margin-bottom: 18px;
}

.ehq-opt-group-lbl {
  font-family: var(--ehq-font);
  font-size: 13px;
  font-weight: 600;
  color: var(--ehq-dark);
  margin-bottom: 8px;
  display: block;
}

/* ── Option Buttons ──────────────────────────────────────────────────────── */
.ehq-opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.ehq-opts--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ehq-btn {
  width: 100%;
  padding: 13px 16px;
  background: var(--ehq-input-bg);
  border: 1.5px solid var(--ehq-border);
  border-radius: var(--ehq-radius-sm);
  font-family: var(--ehq-font);
  font-size: 14px;
  font-weight: 400;
  color: var(--ehq-dark);
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition:
    border-color var(--ehq-transition),
    background var(--ehq-transition),
    color var(--ehq-transition);
  line-height: 1.4;
  box-sizing: border-box;
}

.ehq-btn:hover {
  border-color: var(--ehq-green);
  background: var(--ehq-green-light);
  color: var(--ehq-green-dark);
}

.ehq-btn--sel {
  background: var(--ehq-green-light);
  border-color: var(--ehq-green);
  color: var(--ehq-green-dark);
  font-weight: 600;
}

.ehq-btn--sel::after {
  content: '✓';
  font-size: 13px;
  font-weight: 700;
  color: var(--ehq-green);
  flex-shrink: 0;
  margin-left: 8px;
}

.ehq-btn--highlight {
  background: var(--ehq-green-light);
  border-color: var(--ehq-green);
  border-width: 2px;
  font-weight: 500;
}

/* ── Select dropdown ────────────────────────────────────────────────────── */
.ehq-select-lbl {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ehq-slate);
  margin-bottom: 6px;
  font-family: var(--ehq-font);
}

.ehq-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b8f9e' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}

/* ── Error message ──────────────────────────────────────────────────────── */
.ehq-error {
  background: #fff3f3;
  border: 1px solid #f5a6a6;
  border-radius: var(--ehq-radius-sm);
  color: #c0392b;
  font-size: 13px;
  font-family: var(--ehq-font);
  padding: 10px 14px;
  margin-bottom: 14px;
  animation: ehqSlideInRight 0.2s ease both;
}

/* ── Contact inputs ──────────────────────────────────────────────────────── */
.ehq-fg {
  margin-bottom: 15px;  /* matches site .form-group spacing */
}

.ehq-input {
  width: 100%;
  padding: 15px 20px;   /* matches site .form-control padding exactly */
  border: none;
  border-radius: var(--ehq-radius-sm);
  background: var(--ehq-input-bg);
  font-family: var(--ehq-font);
  font-size: 16px;      /* matches site font-size */
  font-weight: 400;
  color: #333333;       /* matches site text color */
  outline: none;
  transition: background var(--ehq-transition), box-shadow var(--ehq-transition);
  box-sizing: border-box;
  display: block;
}

.ehq-input:focus {
  background: #e4e4e4;
  box-shadow: inset 0 0 0 2px var(--ehq-green);
}

.ehq-input::placeholder {
  color: #999;
  font-weight: 400;
}

/* ── Submit Button ───────────────────────────────────────────────────────── */
.ehq-submit-btn {
  width: 100%;
  padding: 18px 20px;
  background: var(--ehq-green);
  color: #ffffff;
  font-family: var(--ehq-font);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.8px;   /* tighter — prevents text wrapping on desktop */
  text-transform: uppercase;
  white-space: nowrap;      /* never break onto a second line */
  overflow: hidden;
  text-overflow: ellipsis;
  border: none;
  border-radius: var(--ehq-radius-sm);
  cursor: pointer;
  transition: background var(--ehq-transition), transform 0.1s ease;
  margin-top: 10px;
  margin-bottom: 14px;
  display: block;
  box-sizing: border-box;
}

.ehq-submit-btn:hover {
  background: var(--ehq-green-dark);
}

.ehq-submit-btn:active {
  transform: scale(0.99);
}

/* ── Trust elements ──────────────────────────────────────────────────────── */
.ehq-financing {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--ehq-green-light);
  border: 1px solid rgba(61, 138, 61, 0.2);
  border-radius: var(--ehq-radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ehq-green-dark);
  margin-bottom: 8px;
  font-family: var(--ehq-font);
}

.ehq-trust {
  font-family: var(--ehq-font);
  font-size: 12px;
  font-weight: 400;
  color: var(--ehq-slate);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.5;
}

/* ── Back Button ─────────────────────────────────────────────────────────── */
.ehq-back-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--ehq-font);
  font-size: 13px;
  font-weight: 400;
  color: var(--ehq-slate);
  padding: 6px 0 0;
  display: block;
  transition: color var(--ehq-transition);
  margin-top: 4px;
}

.ehq-back-btn:hover {
  color: var(--ehq-dark);
}

/* ── Success Screen ──────────────────────────────────────────────────────── */
.ehq-success {
  text-align: center;
  padding: 20px 0;
  animation: ehqFadeUp 0.35s ease both;
  font-family: var(--ehq-font);
}

.ehq-success-icon {
  width: 64px;
  height: 64px;
  background: var(--ehq-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.ehq-success-ttl {
  font-family: var(--ehq-font);
  font-size: 22px;
  font-weight: 700;
  color: var(--ehq-dark);
  margin-bottom: 10px;
  line-height: 1.3;
}

.ehq-success-sub {
  font-size: 14px;
  font-weight: 400;
  color: var(--ehq-slate);
  line-height: 1.65;
  margin-bottom: 20px;
}

.ehq-summary {
  background: var(--ehq-green-light);
  border: 1px solid rgba(61, 138, 61, 0.2);
  border-radius: var(--ehq-radius-sm);
  padding: 16px 18px;
  text-align: left;
}

.ehq-summary-ttl {
  font-family: var(--ehq-font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ehq-slate);
  margin-bottom: 12px;
}

.ehq-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
  gap: 10px;
  font-family: var(--ehq-font);
}

.ehq-sum-k {
  color: var(--ehq-slate);
  font-weight: 400;
  flex-shrink: 0;
}

.ehq-sum-v {
  color: var(--ehq-dark);
  font-weight: 600;
  text-align: right;
}

/* ── Modal trigger button ─────────────────────────────────────────────────── */
.ehq-modal-trigger {
  background: var(--ehq-green);
  color: #ffffff;
  font-family: var(--ehq-font);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 16px 36px;
  border: none;
  border-radius: var(--ehq-radius-sm);
  cursor: pointer;
  transition: background var(--ehq-transition);
  display: inline-block;
}

.ehq-modal-trigger:hover {
  background: var(--ehq-green-dark);
}

/* ── Modal overlay ───────────────────────────────────────────────────────── */
.ehq-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 10, 0.65);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.ehq-modal-overlay--open {
  display: flex;
  animation: ehqOverlayIn 0.22s ease both;
}

@keyframes ehqOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.ehq-modal-dialog {
  position: relative;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--ehq-radius-lg);
  animation: ehqDialogIn 0.28s ease both;
  /* scrollbar styling */
  scrollbar-width: thin;
  scrollbar-color: var(--ehq-border) transparent;
}

.ehq-modal-dialog::-webkit-scrollbar { width: 6px; }
.ehq-modal-dialog::-webkit-scrollbar-track { background: transparent; }
.ehq-modal-dialog::-webkit-scrollbar-thumb { background: var(--ehq-border); border-radius: 3px; }

@keyframes ehqDialogIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ehq-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  background: var(--ehq-input-bg);
  border: 1px solid var(--ehq-border);
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  color: var(--ehq-body);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background var(--ehq-transition), color var(--ehq-transition);
  font-family: var(--ehq-font);
}

.ehq-modal-close:hover {
  background: var(--ehq-border);
  color: var(--ehq-dark);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .ehq-card {
    padding: 40px 18px 24px;
    border-radius: var(--ehq-radius-md);
  }

  .ehq-heading {
    font-size: 21px;
  }

  .ehq-subheading {
    font-size: 14px;
  }

  .ehq-opts--grid {
    grid-template-columns: 1fr;
  }

  .ehq-btn {
    padding: 14px 14px;
    font-size: 14px;
  }

  .ehq-input {
    padding: 13px 14px;
    font-size: 15px;
  }

  .ehq-submit-btn {
    font-size: 13px;
    padding: 15px 14px;
    letter-spacing: 1px;
  }

  .ehq-dot {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }

  .ehq-modal-dialog {
    max-height: 95vh;
  }

  .ehq-step-q {
    font-size: 16px;
  }
}

@media (max-width: 380px) {
  .ehq-card {
    padding: 22px 14px 20px;
  }

  .ehq-heading {
    font-size: 19px;
  }
}
