/* ==========================================================================
   Harrigan Creative — Proposal Builder widget
   Self-contained, namespaced (hcpb-*). Safe to drop on any page; scoped
   variables mean it does not depend on styles.css tokens.
   ========================================================================== */

.hcpb-root {
  --hcpb-paper: #f4f7fb;
  --hcpb-paper-2: #e9eef6;
  --hcpb-white: #ffffff;
  --hcpb-rule: #e4e9f1;
  --hcpb-rule-2: #cdd6e3;
  --hcpb-ink: #0a1228;
  --hcpb-ink-soft: #3d4658;
  --hcpb-mut: #697086;
  --hcpb-indigo: #5b54e8;
  --hcpb-indigo-deep: #4338ca;
  --hcpb-violet: #8b5cf6;
  --hcpb-good: #15803d;
  --hcpb-sans: "IBM Plex Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --hcpb-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --hcpb-ease: cubic-bezier(.22, 1, .36, 1);
  --hcpb-shadow: 0 36px 80px -32px rgba(10, 18, 40, .32), 0 10px 24px -12px rgba(10, 18, 40, .16);
}

/* Reset inside the widget so page styles cannot bleed in */
.hcpb-root, .hcpb-root * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  text-transform: none;
  letter-spacing: normal;
  text-align: left;
  text-decoration: none;
  float: none;
  max-width: none;
}
.hcpb-root {
  font-family: var(--hcpb-sans);
  color: var(--hcpb-ink);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   Floating pill (always-visible entry point)
   -------------------------------------------------------------------------- */
.hcpb-pill {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147482000;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: linear-gradient(120deg, var(--hcpb-indigo), var(--hcpb-violet));
  color: #fff;
  font-family: var(--hcpb-sans);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 10px 30px -8px rgba(91, 84, 232, .55);
  transition: transform .25s var(--hcpb-ease), box-shadow .25s var(--hcpb-ease);
  animation: hcpb-pill-in .5s var(--hcpb-ease) both;
}
.hcpb-pill:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -8px rgba(91, 84, 232, .7); }
.hcpb-pill:focus-visible { outline: 3px solid var(--hcpb-violet); outline-offset: 3px; }
.hcpb-pill .hcpb-pill-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, .7);
  animation: hcpb-ping 2.4s var(--hcpb-ease) infinite;
}
.hcpb-pill .hcpb-pill-tag {
  font-family: var(--hcpb-mono);
  font-size: 10px;
  letter-spacing: .08em;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
}
@keyframes hcpb-pill-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes hcpb-ping {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .55); }
  70%, 100% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
}

/* --------------------------------------------------------------------------
   Overlay + modal shell
   -------------------------------------------------------------------------- */
.hcpb-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 18, 40, .58);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .28s var(--hcpb-ease);
  overflow-y: auto;
}
.hcpb-overlay.hcpb-on { opacity: 1; }

.hcpb-modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: var(--hcpb-paper);
  border: 1px solid var(--hcpb-rule);
  border-radius: 20px;
  box-shadow: var(--hcpb-shadow);
  padding: 34px 34px 30px;
  max-height: 92vh;
  overflow-y: auto;
  transform: translateY(16px) scale(.98);
  opacity: 0;
  transition: transform .32s var(--hcpb-ease), opacity .32s var(--hcpb-ease);
}
.hcpb-overlay.hcpb-on .hcpb-modal { transform: none; opacity: 1; }

.hcpb-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--hcpb-rule);
  border-radius: 9px;
  background: var(--hcpb-white);
  color: var(--hcpb-mut);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.hcpb-close:hover { color: var(--hcpb-ink); border-color: var(--hcpb-rule-2); }
.hcpb-close:focus-visible { outline: 3px solid var(--hcpb-violet); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   Shared type
   -------------------------------------------------------------------------- */
.hcpb-eyebrow {
  font-family: var(--hcpb-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--hcpb-indigo);
  margin-bottom: 12px;
}
.hcpb-h {
  font-size: clamp(22px, 4.6vw, 28px);
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.15;
  color: var(--hcpb-ink);
}
.hcpb-sub {
  margin-top: 12px;
  font-size: 15.5px;
  color: var(--hcpb-ink-soft);
}
.hcpb-micro {
  margin-top: 14px;
  font-family: var(--hcpb-mono);
  font-size: 11.5px;
  letter-spacing: .02em;
  color: var(--hcpb-mut);
}

/* screens fade/slide as they swap */
.hcpb-screen { animation: hcpb-screen-in .3s var(--hcpb-ease) both; }
@keyframes hcpb-screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   Progress bar (question steps)
   -------------------------------------------------------------------------- */
.hcpb-progress-wrap { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.hcpb-progress {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--hcpb-paper-2);
  overflow: hidden;
}
.hcpb-progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--hcpb-indigo), var(--hcpb-violet));
  transition: width .4s var(--hcpb-ease);
}
.hcpb-progress-count {
  font-family: var(--hcpb-mono);
  font-size: 11px;
  color: var(--hcpb-mut);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Options (tap answers)
   -------------------------------------------------------------------------- */
.hcpb-q { font-size: clamp(19px, 3.8vw, 22px); font-weight: 600; line-height: 1.2; margin-bottom: 16px; color: var(--hcpb-ink); }
.hcpb-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hcpb-opts.hcpb-one-col { grid-template-columns: 1fr; }
.hcpb-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 14px 15px;
  border: 1.5px solid var(--hcpb-rule);
  border-radius: 12px;
  background: var(--hcpb-white);
  color: var(--hcpb-ink);
  font-family: var(--hcpb-sans);
  font-size: 15px;
  font-weight: 450;
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .12s;
}
.hcpb-opt:hover { border-color: var(--hcpb-indigo); transform: translateY(-1px); }
.hcpb-opt:focus-visible { outline: 3px solid var(--hcpb-violet); outline-offset: 2px; }
.hcpb-opt.hcpb-sel {
  border-color: var(--hcpb-indigo);
  background: rgba(91, 84, 232, .08);
}
.hcpb-opt .hcpb-tick {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--hcpb-rule-2);
  display: inline-flex; align-items: center; justify-content: center;
  color: transparent;
  font-size: 12px;
  transition: background .18s, border-color .18s, color .18s;
}
.hcpb-opt.hcpb-sel .hcpb-tick {
  background: var(--hcpb-indigo);
  border-color: var(--hcpb-indigo);
  color: #fff;
}

/* --------------------------------------------------------------------------
   Actions row + buttons
   -------------------------------------------------------------------------- */
.hcpb-actions { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.hcpb-btn {
  appearance: none;
  border: 0;
  border-radius: 11px;
  padding: 14px 22px;
  background: var(--hcpb-indigo);
  color: #fff;
  font-family: var(--hcpb-sans);
  font-size: 15.5px;
  font-weight: 550;
  cursor: pointer;
  transition: background .2s var(--hcpb-ease), transform .12s;
}
.hcpb-btn:hover { background: var(--hcpb-indigo-deep); }
.hcpb-btn:active { transform: translateY(1px); }
.hcpb-btn:focus-visible { outline: 3px solid var(--hcpb-violet); outline-offset: 2px; }
.hcpb-btn[disabled] { opacity: .5; cursor: not-allowed; }
.hcpb-btn-wide { width: 100%; }
.hcpb-btn-ghost {
  background: transparent;
  color: var(--hcpb-mut);
  padding: 14px 12px;
  font-weight: 450;
}
.hcpb-btn-ghost:hover { background: transparent; color: var(--hcpb-ink); }
.hcpb-spacer { flex: 1; }

/* --------------------------------------------------------------------------
   Building screen
   -------------------------------------------------------------------------- */
.hcpb-building { text-align: center; padding: 30px 10px 24px; }
.hcpb-spinner {
  width: 46px; height: 46px;
  margin: 0 auto 22px;
  border-radius: 50%;
  border: 3px solid var(--hcpb-paper-2);
  border-top-color: var(--hcpb-indigo);
  animation: hcpb-spin .8s linear infinite;
}
@keyframes hcpb-spin { to { transform: rotate(360deg); } }
.hcpb-building-line {
  font-family: var(--hcpb-mono);
  font-size: 13px;
  color: var(--hcpb-mut);
  min-height: 1.4em;
  transition: opacity .3s;
}

/* --------------------------------------------------------------------------
   Plan result
   -------------------------------------------------------------------------- */
.hcpb-plan-title { font-size: clamp(21px, 4vw, 25px); font-weight: 600; letter-spacing: -.01em; }
.hcpb-plan-basis { margin-top: 6px; font-size: 14px; color: var(--hcpb-mut); }
.hcpb-plan-body { margin-top: 20px; display: grid; gap: 14px; }
.hcpb-card {
  border: 1px solid var(--hcpb-rule);
  border-radius: 13px;
  background: var(--hcpb-white);
  padding: 16px 18px;
}
.hcpb-card-label {
  font-family: var(--hcpb-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--hcpb-violet);
  margin-bottom: 8px;
}
.hcpb-card-focus { font-size: 17px; font-weight: 600; color: var(--hcpb-ink); }
.hcpb-card-why { margin-top: 6px; font-size: 14.5px; color: var(--hcpb-ink-soft); }
.hcpb-stack { list-style: none; display: grid; gap: 9px; }
.hcpb-stack li { display: flex; gap: 10px; font-size: 14.5px; color: var(--hcpb-ink-soft); }
.hcpb-stack li::before {
  content: "";
  flex: 0 0 auto;
  margin-top: 7px;
  width: 7px; height: 7px;
  border-radius: 2px;
  background: var(--hcpb-good);
}
.hcpb-card-line { font-size: 14.5px; color: var(--hcpb-ink-soft); }
.hcpb-plan-note {
  margin-top: 16px;
  font-size: 13.5px;
  color: var(--hcpb-mut);
  border-left: 2px solid var(--hcpb-rule-2);
  padding-left: 12px;
}

/* --------------------------------------------------------------------------
   Capture form
   -------------------------------------------------------------------------- */
.hcpb-form { margin-top: 18px; display: grid; gap: 12px; }
.hcpb-field { display: grid; gap: 6px; }
.hcpb-field label {
  font-family: var(--hcpb-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--hcpb-mut);
}
.hcpb-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--hcpb-rule);
  border-radius: 10px;
  background: var(--hcpb-white);
  font-family: var(--hcpb-sans);
  font-size: 15px;
  color: var(--hcpb-ink);
  transition: border-color .18s;
}
.hcpb-field input:focus { outline: none; border-color: var(--hcpb-indigo); }
.hcpb-field input::placeholder { color: var(--hcpb-mut); }
.hcpb-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* honeypot: visually hidden but reachable to bots */
.hcpb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.hcpb-turnstile { margin-top: 4px; min-height: 65px; }
.hcpb-error {
  font-size: 13.5px;
  color: #b42318;
  margin-top: 2px;
  min-height: 1.2em;
}

/* --------------------------------------------------------------------------
   Thank-you
   -------------------------------------------------------------------------- */
.hcpb-thanks { text-align: center; padding: 18px 6px 10px; }
.hcpb-check {
  width: 56px; height: 56px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: rgba(21, 128, 61, .12);
  color: var(--hcpb-good);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.hcpb-sig { margin-top: 14px; font-size: 14px; color: var(--hcpb-mut); }

/* --------------------------------------------------------------------------
   Mobile: modal becomes a bottom sheet
   -------------------------------------------------------------------------- */
@media (max-width: 560px) {
  .hcpb-overlay { padding: 0; align-items: flex-end; }
  .hcpb-modal {
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 26px 20px 24px;
    max-height: 94vh;
    overflow-y: auto;
  }
  .hcpb-opts { grid-template-columns: 1fr; }
  .hcpb-row-2 { grid-template-columns: 1fr; }
  .hcpb-pill { right: 14px; bottom: 14px; padding: 11px 15px; font-size: 14px; }
  .hcpb-pill .hcpb-pill-tag { display: none; }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .hcpb-root *, .hcpb-overlay, .hcpb-modal, .hcpb-screen, .hcpb-pill { animation: none !important; transition: none !important; }
}

/* lock page scroll while open */
body.hcpb-lock { overflow: hidden; }
