/*
 * Scoped for embedding inside the footeprinting_com "spine_calculator" page
 * layout (see xsl/sty_page_layouts.xsl) and restyled onto the site's
 * Bootstrap 3.3.5 (panel/well/form-control/btn/modal/dropdown-menu/sr-only).
 * This file now only carries the bits Bootstrap has no component for:
 * the measurement/eyebrow typography, the custom paper/cover stock picker
 * dropdowns (JS-built, so their classes can't change), the big result
 * numbers, and the lead-capture overlay's positioning. Everything else
 * (buttons, inputs, selects, panel, wells, form layout, modal chrome,
 * visually-hidden helpers) is plain Bootstrap now.
 *
 * Selectors that touch bare tags (`*`, `body`, `select`, `input`, `button`,
 * `[hidden]`) stay namespaced under #spine-calculator-app so this sheet
 * can't leak onto the site header/footer/other page content.
 */
#spine-calculator-app {
  --ink: #151515;
  --muted: #666;
  --soft: #f6f6f6;
}

#spine-calculator-app,
#spine-calculator-app * {
  box-sizing: border-box;
}

#spine-calculator-app {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #ffffff 0%, #f7f7f7 100%);
  color: var(--ink);
}

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 32px 18px;
}

#spine-calculator-app [hidden] {
  display: none !important;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

#spine-calculator-app h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1;
}

.intro {
  color: var(--muted);
}

/* -- Result stat boxes: bootstrap .well handles the box; this is just the
      oversized number typography, which has no bootstrap equivalent. -- */
.result-box strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.8rem, 6vw, 3rem);
  line-height: 1;
}

/* -- Paper / cover stock pickers: a custom button + menu widget driven
      directly by spineCalculator.js (open/close via the `hidden` attribute,
      not Bootstrap's dropdown.js), styled with real Bootstrap dropdown-menu
      chrome. The generic .dropdown-menu{display:none} needs an override
      since we're not using Bootstrap's `.open` toggle class. -- */
.paper-picker,
.cover-picker {
  position: relative;
}

.paper-picker-button,
.cover-picker-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

#spine-calculator-app .dropdown-menu:not([hidden]) {
  display: block;
}

.paper-picker-menu,
.cover-picker-menu {
  right: 0;
  max-height: 460px;
  overflow-y: auto;
}

.paper-picker-group + .paper-picker-group,
.cover-picker-group + .cover-picker-group,
.text-cover-options + .cover-picker-group,
.cover-picker-group + .text-cover-options {
  border-top: 1px solid #ececec;
  margin-top: 8px;
  padding-top: 8px;
}

.paper-picker-group-title,
.cover-picker-group-title {
  padding: 7px 10px 5px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.paper-choice,
.cover-choice {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 3px;
  padding: 9px 10px;
  background: transparent;
  text-align: left;
  font-weight: 500;
}

.paper-choice:hover,
.paper-choice:focus-visible,
.cover-choice:hover,
.cover-choice:focus-visible {
  background: var(--soft);
  outline: none;
}

.paper-choice.selected,
.cover-choice.selected {
  background: #337ab7;
  color: #fff;
  font-weight: 800;
}

.text-cover-options {
  margin: 8px 0 0;
  border-top: 1px solid #ececec;
  padding-top: 8px;
}

.text-cover-options summary {
  cursor: pointer;
  padding: 10px;
  border-radius: 3px;
  font-weight: 900;
  user-select: none;
}

.text-cover-options summary:hover,
.text-cover-options summary:focus-visible {
  background: var(--soft);
  outline: none;
}

.text-cover-note {
  margin: 2px 10px 7px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.cover-picker-utility {
  margin-top: 8px;
  padding-top: 8px;
}

/* -- Lead-capture overlay: shown/hidden by spineCalculator.js toggling the
      `hidden` attribute directly, so it can't use Bootstrap's own
      .modal/.in JS-driven display toggle. .modal-backdrop/.modal-content/
      .modal-header/.modal-body/.close on the inner elements still get
      Bootstrap's real styling; only positioning/stacking is custom here. -- */
.lead-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.lead-modal-backdrop {
  z-index: 0;
}

.lead-modal-panel {
  z-index: 1;
  width: min(100%, 460px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.lead-modal-copy {
  color: var(--muted);
}

.lead-modal-open {
  overflow: hidden;
}
