/* Campaign Builder — editorial styling, tuned to sit beside a premium
   photo/design studio site (monochrome + a single warm gold accent).
   Built 2026-05-22. Deliberately NOT the teal heat-pump look. */

:root {
  --color-ink: #141414;
  --color-ink-soft: #6c6760;
  --color-accent: #b08842;        /* warm gold — partner-config overrides this */
  --color-accent-soft: #f4ecdd;   /* pale gold wash for selected state */
  --color-line: #e7e3d9;          /* hairline borders */
  --color-surface: #faf9f6;       /* warm off-white */
  --color-bg-page: #ffffff;
  --color-error: #b42318;
  --radius: 5px;
  --radius-pill: 999px;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --max-width: 640px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--font-body);
  color: var(--color-ink);
  /* background lives on body only: it propagates to the canvas anyway, and
     popup mode needs to clear it (a bg on <html> would paint the whole
     transparent popup iframe white). */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

body { background: var(--color-bg-page); }

body {
  min-height: 100vh;
  padding: 24px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

body.is-embedded {
  background: transparent;
  padding: 0;
  min-height: 0;
}

body.is-embedded .tool-container {
  box-shadow: none;
  border: none;
  border-radius: 0;
  max-width: none;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.is-embedded .tool-main { flex: 1; }

/* --- Trigger card ------------------------------------------------------- */

.tool-container {
  width: 100%;
  max-width: var(--max-width);
  background: rgba(255, 255, 255, 0.80);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--color-line);
  overflow: hidden;
}

.tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 26px;
  border-bottom: 1px solid var(--color-line);
}

.tool-header .brand { display: flex; align-items: center; text-decoration: none; }
.tool-header .brand img { display: block; height: 30px; width: auto; }

.tool-title {
  color: var(--color-ink-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tool-main { padding: 48px 36px; }

.eyebrow {
  color: var(--color-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

h1 {
  color: var(--color-ink);
  font-size: 34px;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

h2 {
  color: var(--color-ink);
  font-size: 25px;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--color-ink-soft);
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 30px;
  max-width: 30em;
}

/* Mark 2026-06-12: intro line in bold */
.subtitle-bold {
  font-weight: 700;
  color: var(--color-ink);
}

/* Mark 2026-06-12: the "Build my Brief" trigger is red (step/submit buttons
   stay black) */
.btn-primary[data-action="openModal"] { background: var(--btn-cta, var(--color-ink)); }
.btn-primary[data-action="openModal"]:hover { background: #a82222; }

.tool-footer {
  padding: 16px 26px;
  border-top: 1px solid var(--color-line);
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-ink-soft);
}

.tool-footer a { color: var(--color-ink); text-decoration: none; }
.tool-footer a:hover { text-decoration: underline; }

/* --- Buttons ------------------------------------------------------------ */

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--color-ink);
  color: #fff;
  border: none;
  padding: 15px 30px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s, opacity 0.18s, transform 0.1s;
}

.btn-primary:hover { background: #2f2f2f; }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.3; cursor: not-allowed; pointer-events: none; }
.btn-primary .arrow { transition: transform 0.18s; }
.btn-primary:hover .arrow { transform: translateX(3px); }

.btn-secondary {
  background: transparent;
  color: var(--color-ink);
  border: 1px solid var(--color-line);
  padding: 12px 26px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.btn-secondary:hover { border-color: var(--color-ink); background: var(--color-surface); }

/* --- Modal shell -------------------------------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }

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

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.55);
  cursor: pointer;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 580px;
  max-height: min(86vh, 780px);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--radius);
  box-shadow: 0 30px 70px rgba(20, 20, 20, 0.32);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.05);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--color-line);
  flex-shrink: 0;
}

.modal-title {
  color: var(--color-ink-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.btn-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-line);
  background: transparent;
  color: var(--color-ink);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.btn-close:hover { background: var(--color-surface); border-color: var(--color-ink); }

.modal-main { flex: 1; overflow-y: auto; padding: 30px 30px 34px; }

body.modal-open { overflow: hidden; }

/* --- Steps -------------------------------------------------------------- */

.step { display: none; animation: stepIn 0.34s ease; }
.step.active { display: block; }

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

.progress-bar {
  display: none;
  height: 2px;
  background: var(--color-line);
  overflow: hidden;
  margin-bottom: 30px;
}

.progress-bar.show { display: block; }

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  transition: width 0.4s ease;
}

.step-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.btn-back {
  background: none;
  border: none;
  color: var(--color-ink-soft);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 6px 10px;
  margin-left: -10px;
  border-radius: 4px;
  transition: color 0.15s;
}

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

.step-counter {
  font-size: 11px;
  color: var(--color-ink-soft);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.step-help {
  color: var(--color-ink-soft);
  font-size: 16px;
  line-height: 1.55;
  margin-bottom: 24px;
}

/* --- Option cards ------------------------------------------------------- */

.option-group {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 30px;
}

.option-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--color-bg-page);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.option-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-card:hover { border-color: var(--color-ink); }

.option-card:has(input:checked) {
  border-color: var(--color-ink);
  background: var(--color-surface);
}

.option-body { flex: 1; min-width: 0; }

.option-label {
  display: block;
  color: var(--color-ink);
  font-weight: 700;
  font-size: 17.5px;
  letter-spacing: -0.01em;
}

.option-desc {
  display: block;
  color: var(--color-ink-soft);
  font-size: 15px;
  margin-top: 3px;
  line-height: 1.45;
}

.option-tick {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--color-line);
  border-radius: 50%;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}

.option-group[data-multi] .option-tick { border-radius: 6px; }

.option-card:hover .option-tick { border-color: var(--color-ink-soft); }

.option-card:has(input:checked) .option-tick {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.option-card:has(input:checked) .option-tick::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 3px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* --- Result ------------------------------------------------------------- */

.plan-hero { margin-bottom: 22px; }

.plan-summary {
  color: var(--color-ink);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin-top: 6px;
}

.plan-summary.loading { opacity: 0.55; }

.timeline-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 28px 20px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-surface);
  margin-bottom: 18px;
}

.timeline-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
}

.timeline-value {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--color-accent);
}

.timeline-detail {
  font-size: 13px;
  color: var(--color-ink-soft);
}

.fasttrack-note {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--color-ink);
  background: var(--color-accent-soft);
  border-left: 3px solid var(--color-accent);
  padding: 12px 14px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 18px;
}

.breakdown {
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: 4px 18px;
  margin-bottom: 16px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid var(--color-line);
}

.breakdown-row:last-child { border-bottom: none; }

.breakdown-key {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
  flex-shrink: 0;
  padding-top: 2px;
}

.breakdown-val {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--color-ink);
  text-align: right;
}

.result-fineprint {
  font-size: 12px;
  color: var(--color-ink-soft);
  line-height: 1.5;
  margin-bottom: 22px;
}

.next-step {
  border: 1px solid var(--color-ink);
  border-radius: var(--radius);
  padding: 22px;
}

.next-step h3 {
  color: var(--color-ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.next-step p {
  color: var(--color-ink-soft);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 16px;
}

/* --- Lead form ---------------------------------------------------------- */

.form-row { margin-bottom: 16px; }

.form-row label {
  display: block;
  color: var(--color-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 7px;
}

.form-row label .optional {
  color: var(--color-ink-soft);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.form-row input {
  width: 100%;
  padding: 13px 15px;
  background: var(--color-bg-page);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  color: var(--color-ink);
  transition: border-color 0.15s;
}

.form-row input:focus {
  outline: none;
  border-color: var(--color-ink);
}

.error-msg {
  display: block;
  color: var(--color-error);
  font-size: 13px;
  margin-top: 6px;
  min-height: 16px;
}

.form-fineprint {
  font-size: 12px;
  color: var(--color-ink-soft);
  line-height: 1.5;
  margin-top: 16px;
}

.turnstile-row {
  margin-top: 18px;
  margin-bottom: 8px;
}
.turnstile-widget {
  min-height: 65px;
  display: flex;
  align-items: center;
}
.turnstile-widget:empty {
  display: none;
}
.turnstile-widget:empty + .error-msg {
  display: none;
}

.lead-form .btn-primary { margin-top: 6px; }

/* --- Thanks ------------------------------------------------------------- */

.thanks-hero { text-align: center; padding: 12px 0; }

.success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: var(--color-ink);
  color: #fff;
  font-size: 28px;
  border-radius: 50%;
  margin-bottom: 18px;
}

.estimate-recap {
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 22px 0;
  text-align: left;
  font-size: 14px;
  color: var(--color-ink-soft);
}

.estimate-recap p { margin: 0; line-height: 1.5; }
.estimate-recap strong { color: var(--color-ink); font-weight: 700; }

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 480px) {
  body { padding: 0; }
  .tool-container { border: none; }
  .tool-main { padding: 34px 22px; }
  h1 { font-size: 27px; }
  h2 { font-size: 22px; }
  .timeline-value { font-size: 34px; }
  .modal-overlay { padding: 0; }
  .modal-card {
    max-width: 100%;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }
  .modal-main { padding: 26px 22px 30px; }
  .breakdown-val { font-size: 14px; }
}

/* --- Loader modes ------------------------------------------------------- */
/* view=modal: form fills the loader's full-screen popup iframe (no trigger
   card, no clipping). The loader draws the dark backdrop + rounded frame. */

body.is-popup {
  background: transparent;
  padding: 0;
  min-height: 0;
  display: block;
}

body.is-popup .tool-container { display: none; }

/* The loader's host (a top-layer <dialog>) draws the dim backdrop and fills
   the viewport with a transparent iframe; in here the widget just centres its
   regular .modal-card. Backdrop stays transparent (no double dim) but remains
   clickable, so clicking outside the card still closes the popup. */
body.is-popup .modal-backdrop { background: transparent; }

/* embed=card: show only the trigger card; the in-frame modal is disabled and
   the open click is handed to the parent loader (which opens the popup). */

body.is-card-only .modal-overlay { display: none !important; }
body.is-card-only.is-embedded .tool-container { min-height: 0; }

/* --- Card-mode presence (2026-06-11, v2) ----------------------------------
   Partner feedback: beside a hero, the trigger card read too small to be
   recognised as a form builder. The card keeps the original layout (eyebrow,
   headline, subtitle, CTA) but scales its type with the iframe width — which
   embed.js now sets explicitly — so it reads as a proper panel, not a banner.
   Scoped to body.is-card-only — the full tool and the popup are untouched. */

/* The header strip already reads "Campaign Builder" — the gold eyebrow would
   say it twice in card mode, so it yields its space to the headline. */
body.is-card-only .eyebrow { display: none; }

body.is-card-only .tool-main {
  padding: clamp(42px, 13vw, 70px) clamp(24px, 7.5vw, 48px) clamp(36px, 11vw, 62px);
}

body.is-card-only h1 {
  font-size: clamp(30px, 9.5vw, 52px);
  margin-bottom: 16px;
}

body.is-card-only .subtitle {
  font-size: clamp(15px, 4.4vw, 19px);
  margin-bottom: 30px;
}

body.is-card-only .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 19px 30px;
  font-size: clamp(15px, 4.2vw, 18px);
}

body.is-card-only .tool-header .brand img { height: clamp(28px, 8vw, 34px); }
