/* ================================================================
   Rosebrick Estimator — Frontend Styles
   Scoped under .rbe-wrap to avoid conflicts with theme styles.
   ================================================================ */

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

.rbe-wrap {
  /* Colours — override any of these in your theme CSS to reskin the estimator.
     e.g.  .rbe-wrap { --rbe-dark: #1b2a3b; --rbe-accent: #e05c2a; }          */
  --rbe-dark:        var(--rbe-color-dark,        #1a1a1a);
  --rbe-dark-soft:   var(--rbe-color-dark-soft,   #2a2a2a);
  --rbe-paper:       var(--rbe-color-paper,       #ffffff);
  --rbe-surface:     var(--rbe-color-surface,     #f5f5f3);
  --rbe-line:        var(--rbe-color-line,        #e2e2dc);
  --rbe-muted:       var(--rbe-color-muted,       #666660);
  --rbe-muted-light: var(--rbe-color-muted-light, #999993);
  --rbe-accent:      var(--rbe-color-accent,      #9AC31C);

  /* Aliases used throughout (keeps selector changes minimal) */
  --ink:        var(--rbe-dark);
  --ink-soft:   var(--rbe-dark-soft);
  --paper:      var(--rbe-paper);
  --site:       var(--rbe-surface);
  --line:       var(--rbe-line);
  --grey:       var(--rbe-muted);
  --grey-light: var(--rbe-muted-light);
  --lime:       var(--rbe-accent);
  --lime-deep:  var(--rbe-accent);
  --lime-tint:  var(--rbe-surface);

  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.07);

  /* Fonts: inherit from the active theme — no custom fonts loaded */
  font-family: inherit;
  color: inherit;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background: var(--site);
}

.rbe-wrap button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- topbar ---------- */
.rbe-topbar {
  background: transparent;
}
.rbe-topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.rbe-steps {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.rbe-step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(0,0,0,.4);
}
.rbe-step .dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,.4);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
}
.rbe-step.active { color: var(--ink); }
.rbe-step.active .dot { background: var(--ink); border-color: var(--ink); color: #fff; }
.rbe-step-sep { width: 26px; height: 2px; background: rgba(0,0,0,.2); }

/* ---------- intro ---------- */
.rbe-intro {
  background: var(--ink);
  color: #fff;
  border-top: 1px solid #23251f;
}
.rbe-intro-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 34px 20px 40px;
}
.rbe-eyebrow {
  font-family: inherit;
  font-size: 12px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 10px;
}
.rbe-intro h1,
.rbe-intro h2,
.rbe-intro h3 {
  color: #fff !important;
  font-family: inherit;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .02em;
  font-size: clamp(28px, 4.6vw, 46px);
  line-height: 1.05;
  max-width: 760px;
}
.rbe-intro p {
  margin-top: 12px;
  color: #fff;
  max-width: 660px;
  font-size: 15.5px;
}
.rbe-rough-note {
  display: inline-flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 18px;
  background: var(--ink-soft);
  border: 1px solid #2c2f27;
  border-left: 4px solid #fff;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  font-size: 13.5px;
  max-width: 660px;
}

/* ---------- layout ---------- */
.rbe-wrap-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}
.rbe-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
}
@media (min-width: 900px) {
  .rbe-grid { grid-template-columns: 1fr 380px; align-items: start; }
}
.rbe-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.rbe-panel + .rbe-panel { margin-top: 22px; }
.rbe-panel h2 {
  font-family: inherit;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 19px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.rbe-panel h2 .tick {
  width: 10px;
  height: 10px;
  background: var(--ink);
  flex: none;
  transform: rotate(45deg);
}
.rbe-panel .sub {
  color: var(--grey);
  font-size: 13.5px;
  margin-top: 4px;
}

/* ---------- type cards ---------- */
.rbe-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 18px;
}
@media (min-width: 640px) { .rbe-type-grid { grid-template-columns: repeat(4, 1fr); } }
.rbe-type-card {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 14px 12px;
  text-align: left;
  transition: border-color .15s, background .15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 118px;
}
.rbe-type-card:hover { border-color: var(--grey-light); }
.rbe-type-card[aria-pressed="true"] { border-color: var(--ink); background: #f6f6f2; }
.rbe-type-card svg { width: 34px; height: 26px; display: block; }
.rbe-type-card .t-name {
  font-family: inherit;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 14px;
  line-height: 1.15;
}
.rbe-type-card .t-rate { font-size: 12px; color: var(--grey); line-height: 1.35; }

/* ---------- sliders + plan ---------- */
.rbe-size-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin-top: 18px;
}
@media (min-width: 760px) { .rbe-size-grid { grid-template-columns: 1fr 1fr; align-items: center; } }
.rbe-slider-row { margin-bottom: 20px; }
.rbe-slider-row:last-child { margin-bottom: 0; }
.rbe-slider-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.rbe-slider-head label { font-weight: 600; font-size: 14px; }
.rbe-slider-val { font-family: inherit; font-weight: 600; font-size: 20px; }
.rbe-wrap input[type="range"] { width: 100%; accent-color: var(--ink); height: 28px; }
.rbe-slider-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--grey-light); margin-top: 2px; }
.rbe-plan-box {
  background: var(--site);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 8px 4px;
  position: relative;
}
.rbe-plan-box .plan-cap {
  position: absolute;
  top: 8px;
  left: 12px;
  font-family: inherit;
  font-size: 10.5px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--grey);
}
.rbe-plan-box svg { width: 100%; height: auto; display: block; }
.rbe-area-line { margin-top: 14px; font-size: 13.5px; color: var(--grey); }
.rbe-area-line strong { color: var(--ink); }
.rbe-area-price { margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.rbe-ap-fig { font-family: inherit; font-weight: 600; font-size: clamp(24px, 3vw, 30px); line-height: 1.1; color: var(--ink); letter-spacing: .01em; }
.rbe-ap-sub { font-size: 12px; color: var(--grey); margin-top: 3px; }
.rbe-ap-up { font-size: 13px; color: var(--grey); margin-top: 8px; }
.rbe-ap-up b { color: var(--ink); font-weight: 600; font-family: inherit; font-size: 15px; }

/* ---------- upgrades ---------- */
.rbe-upg-list { margin-top: 16px; display: grid; gap: 10px; }
.rbe-upg {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color .15s, background .15s;
}
.rbe-upg.on { border-color: var(--ink); background: #f6f6f2; }
.rbe-upg input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--ink); flex: none; }
.rbe-upg .u-body { flex: 1; min-width: 0; }
.rbe-upg .u-name { font-weight: 600; font-size: 14.5px; }
.rbe-upg .u-note { font-size: 12.5px; color: var(--grey); }
.rbe-upg .u-price { font-family: inherit; font-weight: 600; font-size: 16px; white-space: nowrap; text-align: right; }
.rbe-upg .u-price small { display: block; font-family: inherit; font-weight: 500; font-size: 11px; color: var(--grey); }
.rbe-qty { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.rbe-qty button {
  width: 26px; height: 26px;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}
.rbe-qty button:hover { border-color: var(--ink); }
.rbe-qty .q-n { font-weight: 600; min-width: 16px; text-align: center; }
.rbe-flat-note {
  margin-top: 14px;
  background: #f6f6f2;
  border: 1px solid #e3e3db;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13.5px;
  color: #4a4c44;
}

/* ---------- estimate panel ---------- */
.rbe-estimate {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow);
}
.rbe-estimate h1,
.rbe-estimate h2,
.rbe-estimate h3,
.rbe-estimate h4,
.rbe-estimate h5,
.rbe-estimate h6 { color: #fff !important; }
/* --rbe-sticky-offset: set this in your theme CSS to match your navbar height.
   e.g.  .rbe-wrap { --rbe-sticky-offset: 80px; }                             */
@media (min-width: 900px) { .rbe-estimate { position: sticky; top: calc(var(--rbe-sticky-offset, 90px) + 16px); } }
.rbe-estimate .rbe-eyebrow { margin-bottom: 6px; }
.rbe-est-config { font-size: 13px; color: #fff; margin-bottom: 14px; }
.rbe-est-range { font-family: inherit; font-weight: 600; font-size: clamp(28px, 3.4vw, 36px); line-height: 1.1; color: #fff; letter-spacing: .01em; }
.rbe-est-vat { font-size: 13px; color: #fff; margin-top: 6px; }
.rbe-est-vat b { color: #fff; font-weight: 600; }
.rbe-est-tailored { margin-top: 16px; padding-top: 16px; border-top: 1px solid #2c2f27; }
.rbe-est-tailored .t-label { font-family: inherit; font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: #fff; }
.rbe-est-tailored .t-fig { font-family: inherit; font-weight: 600; font-size: 26px; color: #fff; margin-top: 2px; }
.rbe-est-tailored .t-fig small { font-size: 13px; color: #fff; font-family: inherit; font-weight: 400; }
.rbe-est-basis { margin: 18px 0 0; padding: 0; list-style: none; font-size: 12.5px; color: #fff; display: grid; gap: 6px; }
.rbe-est-basis li { padding-left: 16px; position: relative; }
.rbe-est-basis li::before { content: ""; position: absolute; left: 0; top: 7px; width: 7px; height: 7px; background: #fff; transform: rotate(45deg); }

/* ---------- CTA band ---------- */
.rbe-cta-band {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  margin-top: 26px;
  padding: 30px 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.rbe-cta-band h1,
.rbe-cta-band h2,
.rbe-cta-band h3,
.rbe-cta-band h4,
.rbe-cta-band h5,
.rbe-cta-band h6 { font-family: inherit; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: 24px; color: #fff !important; }
.rbe-cta-band p { color: #fff; font-size: 14px; margin-top: 4px; max-width: 540px; }

/* ---------- buttons ---------- */
.rbe-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 15px;
  border: none;
  border-radius: 9px;
  padding: 15px 22px;
  transition: transform .12s, background .15s;
  text-decoration: none;
  cursor: pointer;
}
.rbe-btn:active { transform: scale(.98); }
.rbe-btn-primary { background: #fff; color: var(--ink); width: 100%; margin-top: 20px; }
.rbe-btn-primary:hover { background: #e6e6e0; }
.rbe-btn-dark { background: var(--lime); color: var(--ink); }
.rbe-btn-dark:hover { background: var(--lime-deep); }
.rbe-cta-band .rbe-btn-dark { flex: none; margin-top: 0; }
.rbe-est-small { margin-top: 12px; text-align: center; font-size: 12px; color: #fff; }

@media (max-width: 899px) { .rbe-cta-band { display: none; } }

/* ---------- sticky mobile bar ---------- */
.rbe-mob-bar {
  position: fixed;
  left: 0; right: 0; top: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  z-index: 9999;
}
.rbe-mob-bar .m-fig { font-family: inherit; font-weight: 600; font-size: 17px; color: #fff; line-height: 1.1; }
.rbe-mob-bar .m-sub { font-size: 10.5px; color: var(--grey-light); }
.rbe-mob-bar .rbe-btn { padding: 11px 16px; font-size: 13px; margin: 0; }
.rbe-mob-bar { display: none !important; }

/* ---------- step 2 ---------- */
.rbe-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--grey);
  font-size: 14px;
  font-weight: 500;
  padding: 4px 0;
  margin-bottom: 16px;
}
.rbe-back-link:hover { color: var(--ink); }
.rbe-summary-card {
  background: #f6f6f2;
  border: 1px solid #e3e3db;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14px;
  margin-top: 16px;
  display: grid;
  gap: 4px;
}
.rbe-upload-zone {
  margin-top: 14px;
  border: 2px dashed var(--line);
  border-radius: 10px;
  padding: 22px;
  text-align: center;
  background: var(--site);
  transition: border-color .15s;
  display: block;
  cursor: pointer;
}
.rbe-upload-zone:hover { border-color: var(--ink); }
.rbe-upload-zone .uz-title { font-weight: 600; font-size: 14.5px; }
.rbe-upload-zone .uz-sub { font-size: 12.5px; color: var(--grey); margin-top: 3px; }
.rbe-upload-zone input { display: none; }
.rbe-file-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; justify-content: center; }
.rbe-file-chip {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.rbe-file-chip .fc-dot { width: 7px; height: 7px; background: var(--ink); border-radius: 50%; }
.rbe-works-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 16px; }
@media (min-width: 640px) { .rbe-works-grid { grid-template-columns: 1fr 1fr; } }
.rbe-work {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.rbe-work.on { border-color: var(--ink); background: #f6f6f2; }
.rbe-work input { width: 19px; height: 19px; accent-color: var(--ink); flex: none; margin-top: 1px; }
.rbe-work .w-name { font-weight: 600; font-size: 14px; }
.rbe-work .w-note { font-size: 12.5px; color: var(--grey); }
.rbe-other-input { margin-top: 10px; display: none; }
.rbe-other-input.show { display: block; }

/* ---------- contact form ---------- */
.rbe-form-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 16px; }
@media (min-width: 640px) {
  .rbe-form-grid { grid-template-columns: 1fr 1fr; }
  .rbe-form-grid .full { grid-column: 1 / -1; }
}
.rbe-field label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 5px; }
.rbe-field label span { color: var(--grey); }
.rbe-field input,
.rbe-field textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  font-family: inherit;
  font-size: 14.5px;
  background: #fff;
  color: var(--ink);
}
.rbe-field input:focus,
.rbe-field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(14,15,12,.12); }
.rbe-field .err { display: none; color: #b0361f; font-size: 12px; margin-top: 4px; }
.rbe-field.invalid input { border-color: #c74a30; }
.rbe-field.invalid .err { display: block; }
.rbe-submit-row { margin-top: 20px; }
.rbe-submit-row .rbe-btn-dark { width: 100%; }
@media (min-width: 640px) { .rbe-submit-row .rbe-btn-dark { width: auto; padding-left: 34px; padding-right: 34px; } }
.rbe-privacy-note { font-size: 12px; color: var(--grey); margin-top: 10px; }

/* ---------- form state ---------- */
.rbe-form-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13.5px;
  color: #991b1b;
  margin-top: 14px;
  display: none;
}
.rbe-form-error.show { display: block; }
.rbe-btn-loading { opacity: .6; pointer-events: none; }

/* ---------- success ---------- */
.rbe-success {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 38px 28px;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}
.rbe-success .s-mark {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--lime);
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
}
.rbe-success h2 { font-family: inherit; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: 24px; }
.rbe-success p { color: var(--grey); font-size: 14.5px; margin-top: 10px; }
.rbe-success .rbe-btn { margin-top: 20px; }
.rbe-success .db { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--grey); }

/* ---------- footer ---------- */
.rbe-footer { background: var(--ink); color: #fff; margin-top: 20px; }
.rbe-footer h1,
.rbe-footer h2,
.rbe-footer h3,
.rbe-footer h4,
.rbe-footer h5,
.rbe-footer h6 { color: #fff !important; }
.rbe-foot-inner { max-width: 1120px; margin: 0 auto; padding: 30px 20px 40px; font-size: 12.5px; line-height: 1.7; }
.rbe-foot-inner .f-brand { font-family: inherit; font-weight: 600; letter-spacing: .14em; color: #fff; font-size: 15px; text-transform: uppercase; }
.rbe-foot-inner .f-brand span { color: var(--lime); }
.rbe-foot-inner p { margin-top: 10px; max-width: 860px; }

/* ---------- honeypot (must stay invisible) ---------- */
.rbe-hp-field { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
