/* =============================================================
   CPB Quote Form — Front-End Styles
   All rules scoped under .cpb-qf-wrap to prevent theme conflicts
   ============================================================= */

/* Google Font import handled by PHP enqueue */

.cpb-qf-wrap,
.cpb-qf-wrap *,
.cpb-qf-wrap *::before,
.cpb-qf-wrap *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* CSS Variables */
.cpb-qf-wrap {
  --cpb-yellow:    #F5A800;
  --cpb-yellow-dk: #D48E00;
  --cpb-dark:      #1A1A2E;
  --cpb-dark2:     #16213E;
  --cpb-white:     #FFFFFF;
  --cpb-gray:      #F4F4F6;
  --cpb-border:    #DDDDE3;
  --cpb-text:      #2B2B3A;
  --cpb-muted:     #8A8AA0;
  --cpb-radius:    6px;
  --cpb-font:      'DM Sans', sans-serif;
  --cpb-font-head: 'Bebas Neue', cursive;

  font-family: var(--cpb-font);
  color: var(--cpb-text);
  line-height: 1.5;
}

/* ── Outer shell (yellow border effect) ── */
.cpb-qf-shell {
  background: var(--cpb-yellow);
  padding: 5px;
  border-radius: 10px;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.2);
}

/* ── Dark header ── */
.cpb-qf-header {
  background: var(--cpb-dark);
  border-radius: 6px 6px 0 0;
  padding: 16px 20px;
}

.cpb-qf-title {
  font-family: var(--cpb-font-head);
  color: var(--cpb-white);
  font-size: 1.5rem;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  line-height: 1.2;
}

/* ── White form body ── */
.cpb-qf-body {
  background: var(--cpb-white);
  border-radius: 0 0 5px 5px;
  padding: 20px 18px 18px;
}

/* ── Grid rows ── */
.cpb-qf-row {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.cpb-qf-row--2 { grid-template-columns: 1fr 1fr; }
.cpb-qf-row--1 { grid-template-columns: 1fr; }

/* L H W + unit: 3 equal + 1 wider for select */
.cpb-qf-row--dim {
  grid-template-columns: 1fr 1fr 1fr 130px;
}

/* ── Inputs ── */
.cpb-qf-input,
.cpb-qf-select,
.cpb-qf-textarea {
  font-family: var(--cpb-font);
  font-size: 0.875rem;
  color: var(--cpb-text);
  background: var(--cpb-white);
  border: 1.5px solid var(--cpb-border);
  border-radius: var(--cpb-radius);
  padding: 9px 12px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.cpb-qf-input::placeholder,
.cpb-qf-textarea::placeholder {
  color: var(--cpb-muted);
  font-size: 0.85rem;
}

.cpb-qf-input:focus,
.cpb-qf-select:focus,
.cpb-qf-textarea:focus {
  border-color: var(--cpb-yellow);
  box-shadow: 0 0 0 3px rgba(245, 168, 0, 0.15);
}

/* ── Select wrapper ── */
.cpb-qf-select-wrap {
  position: relative;
}

.cpb-qf-select-wrap::after {
  content: '▾';
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--cpb-muted);
  font-size: 0.8rem;
}

.cpb-qf-select {
  padding-right: 28px;
  cursor: pointer;
  background-color: var(--cpb-white);
  height: 100%;
  min-height: 38px;
}

/* ── Textarea ── */
.cpb-qf-textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.55;
}

/* ── Honeypot ── */
.cpb-qf-hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
  tab-index: -1;
}

/* ── Message banner ── */
.cpb-qf-msg {
  display: none;
  padding: 11px 14px;
  border-radius: var(--cpb-radius);
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 12px;
  text-align: center;
  line-height: 1.4;
}

.cpb-qf-msg.cpb-ok  { display: block; background: #D1FAE5; color: #065F46; }
.cpb-qf-msg.cpb-err { display: block; background: #FEE2E2; color: #991B1B; }

/* ── Submit button ── */
.cpb-qf-btn-wrap {
  text-align: center;
  margin-top: 14px;
}

.cpb-qf-btn {
  font-family: var(--cpb-font-head);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-size: 1.05rem;
  background: var(--cpb-yellow);
  color: var(--cpb-dark);
  border: none;
  border-radius: 999px;
  padding: 12px 40px;
  cursor: pointer;
  display: inline-block;
  min-width: 200px;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(245, 168, 0, 0.4);
  line-height: 1.2;
}

.cpb-qf-btn:hover {
  background: var(--cpb-yellow-dk);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 168, 0, 0.45);
}

.cpb-qf-btn:active {
  transform: translateY(0);
}

.cpb-qf-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Spinner inside button ── */
.cpb-qf-btn .cpb-spin {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0,0,0,0.25);
  border-top-color: var(--cpb-dark);
  border-radius: 50%;
  animation: cpb-spin 0.65s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes cpb-spin {
  to { transform: rotate(360deg); }
}

/* ── Responsive ── */
@media (max-width: 540px) {
  .cpb-qf-row--2 {
    grid-template-columns: 1fr;
  }
  .cpb-qf-row--dim {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 360px) {
  .cpb-qf-row--dim {
    grid-template-columns: 1fr;
  }
  .cpb-qf-shell {
    padding: 3px;
  }
}
