:root{
  /* Defaults (overridden by wp_add_inline_style vars) */
  --cqq-page-bg:#f6f6f6;
  --cqq-form-bg:#ffffff;
  --cqq-primary:#111111;
  --cqq-text:#111111;
  --cqq-muted:#666666;
  --cqq-border:#e9e9e9;

  --cqq-base-font:15px;
  --cqq-heading-font:34px;
  --cqq-label-font:13px;

  --cqq-input-padding:15px;
  --cqq-input-radius:3px;
  --cqq-button-radius:3px;

  --cqq-service-min:220px;
  --cqq-service-pad:16px;
  --cqq-service-icon:34px;

  --cqq-card-radius:14px;
  --cqq-shadow:0 12px 35px rgba(0,0,0,0.08);
}

.cqq-shell{
  padding:60px 18px;
  background: var(--cqq-page-bg);
}

.cqq-inner{
  max-width: 860px;
  margin: 0 auto;
}

.cqq-card{
  background: var(--cqq-form-bg);
  border: 1px solid var(--cqq-border);
  border-radius: var(--cqq-card-radius);
  box-shadow: var(--cqq-shadow);
  padding: 34px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
  font-size: var(--cqq-base-font);
  color: var(--cqq-text);
  animation: cqqFade .25s ease;
}

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

.cqq-h2{
  margin:0 0 18px;
  font-size: var(--cqq-heading-font);
  letter-spacing:-.02em;
  color: var(--cqq-text);
}

.cqq-h3{ margin:0 0 12px; font-size:20px; color: var(--cqq-text); }
.cqq-h4{
  margin:0 0 10px;
  font-size:14px;
  color: var(--cqq-text);
  text-transform:uppercase;
  letter-spacing:.04em;
}

.cqq-muted{
  color: var(--cqq-muted);
  font-size: 13px;
  margin-top: 6px;
}

.cqq-field{ margin: 14px 0; }
.cqq-field label{
  display:block;
  font-size: var(--cqq-label-font);
  color: var(--cqq-muted);
  margin-bottom:8px;
}

.cqq-field input, .cqq-field textarea, .cqq-field select,
.cqq-input-wrap input, .cqq-input-wrap textarea, .cqq-input-wrap select{
  width: 100%;
  border: 1px solid var(--cqq-border);
  border-radius: var(--cqq-input-radius);
  padding: 15px !important;
  font-size: var(--cqq-base-font);
  outline: none;
  transition: box-shadow .15s ease, border .15s ease;
  background:#fff;
}

.cqq-field textarea{ min-height: 120px; }

.cqq-field input:focus, .cqq-input-wrap input:focus,
.cqq-field textarea:focus, .cqq-input-wrap textarea:focus,
.cqq-field select:focus, .cqq-input-wrap select:focus{
  border-color: #bbb;
  box-shadow: 0 0 0 4px rgba(0,0,0,0.06);
}

.cqq-btn{
  margin-top: 18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 12px 18px;
  border-radius: var(--cqq-button-radius);
  border: 1px solid var(--cqq-border);
  background: #ddd;
  color: #333;
  cursor: not-allowed;
  transition: background .12s ease, border .12s ease;
}

@keyframes cqqPulse{
  0%,100%{ transform: scale(1); }
  50%{ transform: scale(1.018); }
}

.cqq-btn.enabled{
  background: var(--cqq-primary);
  color: #fff;
  border-color: var(--cqq-primary);
  cursor: pointer;
  animation: cqqPulse 1.6s ease-in-out infinite;
}
.cqq-btn.clicked{ animation: none !important; transform: none !important; }

.cqq-btn.enabled.clicked,
.cqq-btn.enabled:active{
  animation: none;
}

.cqq-service-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--cqq-service-min), 1fr));
  gap: 14px;
  margin-top: 12px;
}
.cqq-service-btn{
  border:1px solid transparent;
  background:#f2f2f2;
  border-radius: var(--cqq-card-radius);
  padding:18px;
  text-align:left;
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:18px;
  transition: transform .12s ease, background .12s ease, border .12s ease;
  min-height: 118px;
}
.cqq-service-btn:hover{
  transform: translateY(-2px);
  border-color: var(--cqq-border);
}
.cqq-service-btn.selected{
  background: var(--cqq-primary);
  color:#fff;
  transform: scale(1.01);
  border-color: var(--cqq-primary);
}
.cqq-service-icon{
  width:64px;
  height:64px;
  object-fit:cover;
  border-radius:12px;
  background: transparent;
  padding:0;
  flex: 0 0 auto;
}
.cqq-service-icon.placeholder{
  background:#e5e5e5;
}
.cqq-service-meta{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width: 0;
}
.cqq-service-name{
  font-weight:800;
  font-size:18px;
  line-height:1.15;
  margin:0;
}
.cqq-service-desc{
  margin:0;
  font-size:14px;
  color: var(--cqq-muted);
  line-height:1.35;
}
.cqq-service-btn.selected .cqq-service-desc{
  color: rgba(255,255,255,.85);
}


.cqq-service-btn:hover{
  transform: translateY(-2px);
  border-color: var(--cqq-border);
}

.cqq-service-btn.selected{
  background: var(--cqq-primary);
  color:#fff;
  transform: scale(1.01);
}





.cqq-progress{
  height: 8px;
  background:#eee;
  border-radius: 999px;
  overflow:hidden;
  margin: 6px 0 18px;
}
.cqq-progress-bar{
  height:100%;
  width:0;
  background: linear-gradient(90deg, var(--cqq-primary), #444);
  transition: width .25s ease;
}

.cqq-section{
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--cqq-border);
  border-radius: 12px;
  background: #fff;
}

.cqq-group{ padding: 8px 0; }

.cqq-question{
  padding: 12px 0;
  border-top: 1px dashed #eee;
}
.cqq-question:first-child{ border-top: none; }

.cqq-qhead{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}

.cqq-qtitle{ font-weight:700; font-size:15px; }
.cqq-qcontent{
  margin: 8px 0 10px;
  color: var(--cqq-muted);
  font-size: 13px;
}

.cqq-tip{ position:relative; color:var(--cqq-muted); cursor:pointer; user-select:none; }
.cqq-tip-text{
  position:absolute;
  right:0;
  top:22px;
  background:#111;
  color:#fff;
  padding:6px 10px;
  border-radius:10px;
  white-space:nowrap;
  opacity:0;
  transform: translateY(6px);
  transition: .14s ease;
  pointer-events:none;
  font-size:12px;
}
.cqq-tip:hover .cqq-tip-text{ opacity:1; transform: translateY(0); }

.cqq-check-grid{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:6px;
}
.cqq-check{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:14px;
}
.cqq-check input{ width:auto; }

.cqq-toggle{ display:flex; gap:10px; margin-top:6px; }
.cqq-toggle-btn{
  border-radius: var(--cqq-button-radius);
  border:1px solid var(--cqq-border);
  background:#f2f2f2;
  padding:10px 14px;
  cursor:pointer;
}
.cqq-toggle-btn.active{
  background: var(--cqq-primary);
  color:#fff;
  border-color: var(--cqq-primary);
}

.cqq-rating{ font-size: 22px; margin-top: 6px; }
.cqq-star{ color:#ccc; cursor:pointer; margin-right:6px; }
.cqq-star.active{ color: var(--cqq-primary); }

.cqq-actions{ margin-top: 18px; display:flex; justify-content:space-between; align-items:center; gap:10px; }

@media (max-width: 650px){
  .cqq-card{ padding: 22px; }
  .cqq-h2{ font-size: 26px; }
}


.cqq-required{
  color:#d00;
  font-weight:700;
}

.cqq-actions-right{ display:flex; gap:10px; justify-content:flex-end; align-items:center; }

.cqq-btn.secondary{ background: transparent; color: var(--cqq-primary); border-color: var(--cqq-primary); }

.cqq-btn.secondary.enabled{ background: transparent; color: var(--cqq-primary); border-color: var(--cqq-primary); }

.cqq-btn.secondary.enabled:hover{ transform: scale(1.02); }




/* Mobile fixes */
@media (max-width: 640px) {
  .cqq-shell { padding: 5px !important; }
  .cqq-inner { padding: 0 !important; }
  .cqq-card { padding: 16px !important; border-radius: 14px !important; }

  .cqq-actions { flex-wrap: wrap !important; gap: 10px !important; }
  .cqq-actions .cqq-actions-left,
  .cqq-actions .cqq-actions-right { width: 100% !important; }

  /* Button row: Back / Skip / Next */
  .cqq-actions .cqq-actions-left { display:none !important; }

  .cqq-actions-right { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .cqq-actions-right .cqq-send-now { grid-column: 1 / -1; width: 100% !important; }

  .cqq-btn { padding: 10px 12px !important; }
}


/* Thank you page */
.cqq-thankyou{ text-align:center; }
.cqq-thankyou .cqq-h2{ margin-bottom:10px; }
.cqq-thankyou .cqq-muted{ margin-top: 8px; font-size: 16px; }
.cqq-thankyou iframe{ max-width:100%; display:block; margin:0 auto; }

.cqq-social-title{ margin-top:18px; font-weight:800; font-size:14px; text-transform:uppercase; letter-spacing:.04em; color: var(--cqq-muted); }
.cqq-social-grid{ margin-top:12px; display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }
.cqq-social-link{ display:inline-flex; align-items:center; gap:10px; padding:12px 16px; border-radius: var(--cqq-button-radius); border:1px solid var(--cqq-border); background: transparent; color: var(--cqq-text); text-decoration:none; }
.cqq-social-link:hover{ border-color: var(--cqq-primary); transform: translateY(-1px); }
.cqq-social-icon{ display:inline-flex; width:18px; height:18px; color: var(--cqq-primary); }
.cqq-social-icon svg{ width:18px; height:18px; display:block; fill: currentColor; }
.cqq-social-label{ font-weight:700; }
.cqq-social-link.icon-only{ padding:12px 12px; }


/* Thank you title (avoid theme h2 overrides) */
.cqq-thankyou-title{
  margin:0 0 18px;
  font-size: var(--cqq-heading-font);
  font-weight:800;
  letter-spacing:-.02em;
  color: var(--cqq-text);
}

/* Range slider */
.cqq-card input[type='range']{ width:100%; accent-color: var(--cqq-primary); }

/* Inline field validation errors */
.cqq-field-error {
  display: block;
  color: #c0392b;
  font-size: 12px;
  margin-top: 5px;
}
.cqq-field-error:empty { display: none; }

.cqq-form-error {
  color: #c0392b;
  font-size: 13px;
  margin-top: 10px;
}
.cqq-form-error:empty { display: none; }

.cqq-input-error {
  border-color: #c0392b !important;
  box-shadow: 0 0 0 3px rgba(192,57,43,0.1) !important;
}

/* Range slider track uses muted color */
.cqq-card input[type='range']{ width:100%; accent-color: var(--cqq-primary); }
.cqq-card input[type='range']::-webkit-slider-runnable-track{ height:8px; background: var(--cqq-muted); border-radius:999px; }
.cqq-card input[type='range']::-moz-range-track{ height:8px; background: var(--cqq-muted); border-radius:999px; }


/* Thank you CTA row */
.cqq-cta-row{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.cqq-cta-row .cqq-btn{ margin-top:0; animation:none !important; }
.cqq-btn-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:18px;
  height:18px;
  margin-right:10px;
}
.cqq-btn-icon svg{ width:18px; height:18px; fill: currentColor; display:block; }

/* ---- Short form (custom_quote_short) ---- */
.cqq-mount-short .cqq-shell{
  background: transparent;
  padding: 0;
}
.cqq-mount-short .cqq-inner{
  max-width: none;
}
.cqq-mount-short .cqq-card{
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
.cqq-mount-short .cqq-short-btn-wrap .cqq-btn{
  padding: 15px 24px;
  margin-top: 0;
}

.cqq-short-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:flex-start;
}
.cqq-short-row .cqq-field{
  flex:1;
  min-width:150px;
  margin:0;
}
.cqq-short-row .cqq-field label{ white-space:nowrap; }
.cqq-short-btn-wrap{
  flex:0 0 auto !important;
  min-width:0 !important;
  margin:0;
}
.cqq-short-btn-spacer{
  display:block;
  font-size:var(--cqq-label-font);
  margin-bottom:8px;
  visibility:hidden;
}
.cqq-short-btn-wrap .cqq-btn{ margin-top:0; white-space:nowrap; }
@media(max-width:640px){
  .cqq-short-row{ flex-direction:column; }
  .cqq-short-row .cqq-field,
  .cqq-short-btn-wrap{ min-width:0; flex:none; width:100%; }
  .cqq-short-btn-wrap .cqq-btn{ width:100%; }
  .cqq-short-btn-spacer{ display:none; }
}

