/* ==========================================
   Quote calculator — /calculator/

   One flow of numbered sections on the left, a summary that stays put on the
   right. Replaces the four-tab layout, which hid three quarters of the quote
   at any moment and had to tell people to go and open another tab.

   Prefix qc- is deliberate: the old .calc-* rules lived in two stylesheets at
   once and fought each other through body.has-nx-shell overrides. Nothing here
   inherits from them.
   ========================================== */

/* Alpine strips the attribute once it has booted. Without this the blocks it
   guards flash on screen before the first render. */
[x-cloak] { display: none !important; }

.qc-page {
  position: relative;
  z-index: 2;
  padding-bottom: var(--space-10);
}

/* ---------- Hero ---------- */

.qc-hero {
  padding: calc(104px + env(safe-area-inset-top, 0px)) 0 var(--space-5);
}

.qc-hero__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--nx-gutter);
}

/* The stage behind this is a photograph of a bright office window, so the
   heading needs its own ground to stand on. Kept to a strip rather than the
   full panel it used to be: the tool itself should start above the fold. */
.qc-hero__plate {
  padding: 18px 22px;
  border: 1px solid var(--nx-border-glass, var(--border));
  border-radius: var(--nx-radius-lg);
  background: var(--campus-glass-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.qc-hero__title {
  margin: 6px 0 0;
  font-family: var(--nx-font-display, var(--font-display));
  font-size: clamp(26px, 3.4vw, 40px);
  line-height: 1.1;
  font-weight: 700;
  color: var(--campus-ink);
}

.qc-hero__sub {
  margin: 10px 0 0;
  max-width: 46rem;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* ---------- Two-column shell ---------- */

.qc-shell {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--nx-gutter);
}

.qc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

@media (min-width: 981px) {
  .qc-grid {
    grid-template-columns: minmax(0, 1fr) 330px;
  }

  .qc-summary {
    position: sticky;
    top: 92px;
  }
}

.qc-flow {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* ---------- Section ---------- */

.qc-section {
  padding: var(--space-5);
  border: 1px solid var(--nx-border-glass, var(--border));
  border-radius: var(--nx-radius-lg);
  background: var(--campus-glass-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.qc-section__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  align-items: baseline;
  margin-bottom: 16px;
}

.qc-section__num {
  grid-row: span 2;
  align-self: start;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: var(--nx-radius-orb);
  background: var(--nx-accent);
  color: var(--nx-on-accent);
  font-family: var(--nx-font-mono, var(--font-mono));
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.qc-section__title {
  margin: 0;
  font-family: var(--nx-font-display, var(--font-display));
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--campus-ink);
}

.qc-section__note {
  grid-column: 2;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ---------- 1. Presets ----------
   Flex rather than grid: there are five of them and the last row has to grow
   into the free space instead of leaving a hole beside itself. */

.qc-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.qc-preset {
  flex: 1 1 210px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  text-align: left;
  border: 1px solid var(--nx-border-strong);
  border-radius: var(--nx-radius-md);
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.qc-preset:hover {
  border-color: var(--campus-ink);
  background: var(--nx-tint);
}

.qc-preset.is-on {
  border-color: var(--nx-accent);
  background: var(--nx-tint-strong);
}

.qc-preset__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--nx-radius-sm);
  background: var(--nx-tint-strong);
  color: var(--campus-ink);
  font-size: 15px;
}

.qc-preset__name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--campus-ink);
}

.qc-preset__who {
  display: block;
  margin-top: 3px;
  font-family: var(--nx-font-mono, var(--font-mono));
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* ---------- 2. Roles ---------- */

.qc-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.qc-role {
  flex: 1 1 232px;
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--nx-border-strong);
  border-radius: var(--nx-radius-md);
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.qc-role:hover {
  border-color: var(--campus-ink);
}

.qc-role.is-on {
  border-color: var(--nx-accent);
  background: var(--nx-tint);
}

.qc-role input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.qc-role__box {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--nx-border-strong);
  border-radius: var(--nx-radius-sm);
  color: transparent;
  font-size: 11px;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.qc-role.is-on .qc-role__box {
  border-color: var(--nx-accent);
  background: var(--nx-accent);
  color: var(--nx-on-accent);
}

.qc-role input:focus-visible + .qc-role__box {
  outline: 2px solid var(--campus-ink);
  outline-offset: 2px;
}

.qc-role__name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--campus-ink);
}

.qc-role__spec {
  display: block;
  margin-top: 3px;
  font-family: var(--nx-font-mono, var(--font-mono));
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.qc-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: var(--nx-radius-orb);
  background: var(--text-muted);
}

.qc-dot--simple { background: #4a9d6a; }
.qc-dot--medium { background: #c99a3c; }
.qc-dot--complex { background: #c0603f; }

/* Running total of what has been picked, so the section answers "what did I
   just choose" without a trip to the summary panel. */
.qc-tally {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--nx-border);
  font-family: var(--nx-font-mono, var(--font-mono));
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.qc-tally strong {
  color: var(--campus-ink);
}

/* ---------- Disclosure blocks ---------- */

.qc-fold {
  margin-top: 12px;
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius-md);
}

.qc-fold > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--campus-ink);
  list-style: none;
}

.qc-fold > summary::-webkit-details-marker { display: none; }

.qc-fold > summary::before {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.18s ease;
}

.qc-fold[open] > summary::before {
  transform: rotate(45deg);
}

.qc-fold > summary:focus-visible {
  outline: 2px solid var(--campus-ink);
  outline-offset: -2px;
}

.qc-fold__aside {
  margin-left: auto;
  font-family: var(--nx-font-mono, var(--font-mono));
  font-size: 11px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.qc-fold__body {
  padding: 4px 12px 14px;
}

/* ---------- Resource rows ---------- */

.qc-row {
  display: grid;
  grid-template-columns: minmax(120px, 150px) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 7px 0;
}

.qc-row__label {
  font-size: 13px;
  color: var(--text-secondary);
}

.qc-slider {
  width: 100%;
  height: 3px;
  appearance: none;
  -webkit-appearance: none;
  border-radius: var(--nx-radius-orb);
  background: var(--nx-tint-strong);
  cursor: pointer;
}

.qc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border: none;
  border-radius: var(--nx-radius-orb);
  background: var(--nx-accent);
  cursor: grab;
}

.qc-slider::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border: none;
  border-radius: var(--nx-radius-orb);
  background: var(--nx-accent);
  cursor: grab;
}

.qc-slider:focus-visible {
  outline: 2px solid var(--campus-ink);
  outline-offset: 4px;
}

.qc-figure {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid var(--nx-border-strong);
  border-radius: var(--nx-radius-sm);
}

.qc-num {
  width: 60px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--campus-ink);
  font-family: var(--nx-font-mono, var(--font-mono));
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  appearance: textfield;
  -moz-appearance: textfield;
}

.qc-num::-webkit-outer-spin-button,
.qc-num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qc-num:focus {
  outline: none;
}

.qc-figure:focus-within {
  border-color: var(--campus-ink);
}

.qc-unit {
  font-family: var(--nx-font-mono, var(--font-mono));
  font-size: 11px;
  color: var(--text-muted);
}

/* Shown once the hand-set numbers no longer match what the roles imply. */
.qc-revert {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: var(--nx-radius-sm);
  background: var(--nx-tint);
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.qc-revert__btn {
  margin-left: auto;
  padding: 5px 11px;
  border: 1px solid var(--nx-border-strong);
  border-radius: var(--nx-radius-orb);
  background: transparent;
  color: var(--campus-ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.qc-revert__btn:hover {
  border-color: var(--campus-ink);
}

/* ---------- 3. Support ---------- */

.qc-mix {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 14px;
  font-family: var(--nx-font-mono, var(--font-mono));
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.qc-mix__item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qc-sla {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.qc-tier {
  display: block;
  padding: 12px;
  text-align: left;
  border: 1px solid var(--nx-border-strong);
  border-radius: var(--nx-radius-md);
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.qc-tier:hover { border-color: var(--campus-ink); }

.qc-tier.is-on {
  border-color: var(--nx-accent);
  background: var(--nx-tint-strong);
}

.qc-tier__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.qc-tier__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--campus-ink);
}

.qc-tier__mult {
  font-family: var(--nx-font-mono, var(--font-mono));
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.qc-tier__sla {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.qc-tier__price {
  display: block;
  margin-top: 8px;
  font-family: var(--nx-font-display, var(--font-display));
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--campus-ink);
}

/* Replaces the old full-card empty state, which existed only to tell people to
   go and open a different tab. */
.qc-waiting {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* ---------- 4. Equipment ---------- */

.qc-gear {
  display: flex;
  flex-direction: column;
}

.qc-gear__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--nx-border);
}

.qc-gear__row:last-child { border-bottom: 0; }

.qc-gear__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--campus-ink);
}

.qc-gear__price {
  margin-top: 2px;
  font-family: var(--nx-font-mono, var(--font-mono));
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.qc-step {
  display: flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--nx-border-strong);
  border-radius: var(--nx-radius-orb);
  padding: 2px;
}

.qc-step__btn {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--nx-radius-orb);
  background: transparent;
  color: var(--campus-ink);
  font-size: 13px;
  cursor: pointer;
}

.qc-step__btn:hover { background: var(--nx-tint-strong); }

.qc-step__num {
  width: 38px;
  border: 0;
  background: transparent;
  color: var(--campus-ink);
  font-family: var(--nx-font-mono, var(--font-mono));
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}

.qc-step__num::-webkit-outer-spin-button,
.qc-step__num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qc-gear__sum {
  min-width: 82px;
  text-align: right;
  font-family: var(--nx-font-mono, var(--font-mono));
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.qc-gear__row.is-on .qc-gear__sum { color: var(--campus-ink); }

/* ---------- Summary ---------- */

.qc-quote {
  padding: 18px;
  border: 1px solid var(--nx-border-glass, var(--border));
  border-radius: var(--nx-radius-lg);
  background: var(--campus-glass-strong);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.qc-quote__eyebrow {
  font-family: var(--nx-font-mono, var(--font-mono));
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.qc-quote__amount {
  margin-top: 6px;
  font-family: var(--nx-font-display, var(--font-display));
  font-size: clamp(28px, 3vw, 34px);
  line-height: 1.05;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--campus-ink);
}

.qc-quote__per {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
}

/* The three rows below the headline are exactly the three that make it up.
   The one-off setup fee lives in its own block further down, because putting
   it in this list made the column read as though it did not add up. */
.qc-quote__rows {
  margin: 14px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--nx-border);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.qc-quote__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
}

.qc-quote__key {
  font-size: 13px;
  color: var(--text-secondary);
}

.qc-quote__sub {
  margin-top: 1px;
  font-size: 11px;
  color: var(--text-muted);
}

.qc-quote__val {
  font-family: var(--nx-font-mono, var(--font-mono));
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--campus-ink);
}

.qc-quote__once {
  margin-top: 14px;
  padding: 11px 12px;
  border-radius: var(--nx-radius-md);
  background: var(--nx-tint);
}

.qc-quote__once-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.qc-quote__once-key {
  font-family: var(--nx-font-mono, var(--font-mono));
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.qc-quote__once-val {
  font-family: var(--nx-font-display, var(--font-display));
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--campus-ink);
}

.qc-quote__once-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
}

.qc-quote .btn-nexus {
  width: 100%;
  justify-content: center;
}

.qc-quote__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.qc-quote__hint,
.qc-quote__err,
.qc-quote__ok {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.qc-quote__hint { color: var(--text-muted); }
.qc-quote__err { color: #9b3b32; }
.qc-quote__ok {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--text-secondary);
}

.qc-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  flex: 1 1 100%;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.qc-consent input {
  margin-top: 3px;
  flex: none;
}

.qc-consent a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.qc-quote .btn-nexus.is-disabled,
.qc-quote .btn-nexus:disabled,
.qc-lead .btn-nexus:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  pointer-events: none;
}

.qc-quote__note {
  margin: 12px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Value changed — a short flash so the eye catches which line moved. */
@keyframes qc-flash {
  0%   { background: var(--nx-tint-strong); }
  100% { background: transparent; }
}

.qc-flash {
  animation: qc-flash 0.55s ease-out;
  border-radius: var(--nx-radius-sm);
}

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

.qc-lead {
  max-width: var(--container-max);
  margin: var(--space-8) auto 0;
  padding: var(--space-6) var(--space-5);
  border: 1px solid var(--nx-border-glass, var(--border));
  border-radius: var(--nx-radius-lg);
  background: var(--campus-glass-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.qc-lead h2 {
  margin: 6px 0 0;
  font-family: var(--nx-font-display, var(--font-display));
  font-size: 22px;
  font-weight: 700;
  color: var(--campus-ink);
}

.qc-lead p {
  margin: 8px 0 0;
  max-width: 44rem;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.qc-lead__form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.qc-inp {
  flex: 1 1 220px;
  padding: 11px 13px;
  border: 1px solid var(--nx-border-strong);
  border-radius: var(--nx-radius-md);
  background: var(--campus-glass);
  color: var(--campus-ink);
  font-size: 14px;
}

.qc-inp::placeholder { color: var(--text-muted); }

.qc-inp:focus-visible {
  outline: 2px solid var(--campus-ink);
  outline-offset: 1px;
}

/* ---------- Sticky bar on narrow screens ---------- */

.qc-bar { display: none; }

@media (max-width: 980px) {
  .qc-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px;
    border: 1px solid var(--nx-border-strong);
    border-radius: var(--nx-radius-lg);
    background: var(--campus-glass-strong);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 12px 32px rgba(10, 16, 24, 0.22);
  }

  .qc-bar__key {
    display: block;
    font-family: var(--nx-font-mono, var(--font-mono));
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .qc-bar__val {
    font-family: var(--nx-font-display, var(--font-display));
    font-size: 19px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--campus-ink);
  }

  .qc-bar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
  }

  .qc-bar .btn-nexus {
    padding: 8px 12px;
    font-size: 13px;
  }

  /* The bar covers the foot of the page while it is up. */
  .qc-page { padding-bottom: 84px; }
}

@media (max-width: 620px) {
  .qc-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .qc-row .qc-slider {
    grid-column: 1 / -1;
    order: 3;
  }

  .qc-gear__row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .qc-gear__sum {
    grid-column: 1 / -1;
    text-align: left;
  }
}
