/*
 * calculator.css — calculator-specific styles.
 *
 * Built entirely on the design tokens from styles.css / components.css.
 * No literal hex values — all colors via CSS custom properties.
 *
 * Contents:
 *   1. Layout shell (grid, cards)
 *   2. Step headings
 *   3. Stepper inputs
 *   4. Security level cards
 *   5. IT support cards
 *   6. Estimate panel
 *   7. Mobile summary bar
 *   8. Scheduler modal
 *   9. Section 2 — custom plan CTA
 *  10. Mobile polish
 */

/* ===== 1. Layout shell ===================================================== */

.calc-section {
  background: var(--neutral-offwhite);
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: start;
}

@media (min-width: 1024px) {
  .calc-grid {
    /* Give the form as much space as it needs; fix the estimate panel at 340px.
       This prevents the panel from squeezing the form columns. */
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 40px;
  }

  /* Sticky estimate panel on desktop — clears the fixed header */
  .calc-quote-side {
    position: sticky;
    top: 88px;
  }
}

@media (min-width: 1200px) {
  .calc-grid {
    gap: 48px;
  }
}

.calc-form-card,
.calc-quote-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 32px;
}

@media (min-width: 768px) {
  .calc-form-card,
  .calc-quote-card {
    padding: 40px;
  }
}

/* ===== 2. Step headings ==================================================== */

.calc-step {
  margin-bottom: 44px;
}

.calc-step:last-child {
  margin-bottom: 0;
}

.calc-step__label {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-steel);
  margin-bottom: 6px;
}

.calc-step__title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.45rem;
  color: var(--navy-primary);
  margin-bottom: 6px;
}

.calc-step__hint {
  font-size: 0.93rem;
  color: var(--accent-steel);
  line-height: 1.65;
  margin-bottom: 24px;
}

/* ===== 3. Stepper inputs =================================================== */

/* Users + Devices: always 2 columns.
   These are the two inputs that drive the estimate. */
.stepper-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}


.stepper-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0; /* prevent grid blowout */
}

.stepper-item__label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--navy-primary);
}

.stepper-item__sub {
  font-size: 0.8rem;
  color: var(--accent-steel);
  font-style: italic;
  margin-top: -4px;
}

.stepper {
  display: flex;
  align-items: stretch;
  width: 100%;       /* always fill its container */
  min-width: 0;      /* never force parent to grow */
  border: 2px solid var(--neutral-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
  transition: border-color var(--transition-fast);
}

.stepper:focus-within {
  border-color: var(--accent-steel);
  box-shadow: 0 0 0 3px rgba(54, 67, 77, 0.1);
}

.stepper__btn {
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--neutral-offwhite);
  border: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--navy-primary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  -webkit-user-select: none;
  user-select: none;
}

.stepper__btn:hover {
  background: var(--neutral-light);
  color: var(--navy-primary);
}

.stepper__btn:active {
  background: var(--navy-primary);
  color: var(--white);
}

.stepper__input {
  flex: 1;
  min-width: 0;
  padding: 10px 4px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--navy-primary);
  text-align: center;
  border: none;
  outline: none;
  background: var(--white);
  -moz-appearance: textfield;
}

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

/* ===== 4. Security level cards ============================================= */

/* Split-tracks toggle row */
.split-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  margin-bottom: 0;
  font-size: 0.88rem;
  color: var(--accent-steel);
  cursor: pointer;
}

.split-toggle-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--navy-primary);
}

.split-toggle-row__text {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--navy-primary);
  font-size: 0.85rem;
}

/* Two-card grid for linked + per-track split */
.level-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Track label (for split mode) */
.track-label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent-steel);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
  margin-top: 20px;
}

.track-label:first-child {
  margin-top: 0;
}

/* The cards themselves */
.level-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px 18px 18px;
  background: var(--white);
  border: 2px solid var(--neutral-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.level-card:hover {
  border-color: var(--accent-steel);
  box-shadow: var(--shadow-sm);
}

.level-card--selected {
  border-color: var(--navy-primary);
  background: rgba(12, 21, 40, 0.03);
  box-shadow: 0 0 0 3px rgba(12, 21, 40, 0.08);
}

/* Selected check badge */
.level-card--selected::after {
  content: '';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 18px;
  height: 18px;
  background: var(--navy-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='2 6 5 9 10 3'/%3E%3C/svg%3E") center / 11px no-repeat;
  border-radius: 50%;
}

.level-card__name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--navy-primary);
  margin-bottom: 4px;
  padding-right: 20px; /* clear the check badge */
}

.level-card__price {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-steel);
  margin-bottom: 10px;
}

.level-card--selected .level-card__price {
  color: var(--navy-primary);
}

.level-card__best-for {
  font-size: 0.83rem;
  color: var(--accent-steel);
  line-height: 1.55;
  flex: 1;
}

/* Advanced card — subtle visual distinction */
.level-card[data-level="advanced"] {
  border-color: rgba(54, 67, 77, 0.25);
}

.level-card[data-level="advanced"]:not(.level-card--selected) {
  background: rgba(54, 67, 77, 0.02);
}

/* ===== 5. IT support cards ================================================= */

.it-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 560px) {
  .it-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.it-card {
  display: flex;
  flex-direction: column;
  padding: 20px 18px 18px;
  background: var(--white);
  border: 2px solid var(--neutral-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  position: relative;
}

.it-card:hover {
  border-color: var(--accent-steel);
  box-shadow: var(--shadow-sm);
}

.it-card--selected {
  border-color: var(--navy-primary);
  background: rgba(12, 21, 40, 0.03);
  box-shadow: 0 0 0 3px rgba(12, 21, 40, 0.08);
}

.it-card--selected::after {
  content: '';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 18px;
  height: 18px;
  background: var(--navy-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='2 6 5 9 10 3'/%3E%3C/svg%3E") center / 11px no-repeat;
  border-radius: 50%;
}

.it-card__name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  color: var(--navy-primary);
  margin-bottom: 4px;
  padding-right: 20px;
}

.it-card__price {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--accent-steel);
  margin-bottom: 10px;
}

.it-card--selected .it-card__price {
  color: var(--navy-primary);
}

/* Single spec line — used on the "As Needed" card only */
.it-card__spec {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.76rem;
  color: var(--accent-steel);
  line-height: 1.4;
  margin-bottom: 8px;
}

.it-card--selected .it-card__spec {
  color: var(--navy-primary);
}

/* Prose body — used on the "As Needed" card only */
.it-card__best-for {
  font-size: 0.83rem;
  color: var(--accent-steel);
  line-height: 1.55;
  flex: 1;
}

/* ── Spec-line checklist (IT Standard and IT Unlimited) ─────────────────────
 * Key–value rows replace the prose body on cards with multiple attributes.
 * Two-column mini-table: label fixed-width on left, value fills the rest.
 */
.it-card__specs {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.it-card__spec-row {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 6px;
  align-items: baseline;
}

.it-card__spec-key {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-steel);
  padding-top: 1px;
  white-space: nowrap;
}

.it-card--selected .it-card__spec-key {
  color: var(--navy-primary);
}

.it-card__spec-val {
  font-size: 0.8rem;
  color: var(--charcoal);
  line-height: 1.45;
}

.it-card__minimum {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 8px;
  background: var(--neutral-offwhite);
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--accent-steel);
}

/* ===== 6. Estimate panel =================================================== */

.quote-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.quote-label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-steel);
}

/* Empty state */
.est-empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--accent-steel);
  font-size: 0.92rem;
  line-height: 1.65;
}

.est-empty__icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 14px;
  opacity: 0.5;
  color: var(--accent-steel);
}

/* Content (shown when total > 0) */
.est-content {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.est-total-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}

.est-total {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(2.4rem, 5.5vw, 3.4rem);
  color: var(--navy-primary);
  line-height: 1.05;
}

.est-per-month {
  font-size: 0.9rem;
  color: var(--accent-steel);
  margin-top: 4px;
}

/* Line item breakdown */
.est-breakdown {
  background: var(--neutral-offwhite);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 16px;
}

.est-breakdown__title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent-steel);
  margin-bottom: 12px;
}

.est-line {
  display: flex;
  justify-content: space-between;
  /* flex-start keeps the amount anchored to the top of the row even when
     the left column has two lines of text */
  align-items: flex-start;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--neutral-light);
}

.est-line:first-of-type {
  border-top: none;
  padding-top: 0;
}

/* Left column: service name + calculation detail stacked */
.est-line__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.est-line__name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--navy-primary);
  line-height: 1.3;
}

.est-line__detail {
  font-size: 0.78rem;
  color: var(--accent-steel);
  line-height: 1.3;
}

/* Right column: dollar amount — never wraps */
.est-line__amount {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--navy-primary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.est-line__note {
  font-size: 0.8rem;
  color: var(--accent-steel);
  line-height: 1.5;
  font-style: italic;
  padding: 6px 0 8px;
  margin: 0;
}

/* Divider + total line */
.est-total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: var(--navy-primary);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.est-total-line__label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--white);
}

.est-total-line__amount {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--white);
}

/* Disclaimer */
.est-disclaimer {
  font-size: 0.8rem;
  color: var(--accent-steel);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* CTA button in panel */
.est-cta {
  width: 100%;
  text-align: center;
}

/* ===== 7. Mobile summary bar =============================================== */

.mobile-summary-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--navy-primary);
  padding: 12px 20px;
  box-shadow: 0 -4px 24px rgba(12, 21, 40, 0.18);
}

@media (max-width: 1023px) {
  .mobile-summary-bar {
    display: block;
  }

  /* Below 1024 px the grid collapses to single-column, so the estimate panel
     re-enters the normal flow (form → panel → custom CTA). Hide the panel on
     narrow screens only and rely on the mobile summary bar instead. */
  .calc-quote-side {
    display: none;
  }

  /* Add bottom padding so the fixed mobile bar doesn't overlap content */
  .calc-section {
    padding-bottom: calc(var(--section-padding-mobile) + 80px);
  }

  .custom-section {
    padding-bottom: 80px;
  }
}

/* On medium screens (768–1023px) show the estimate panel inline instead of
   the mobile bar — the bar is really only useful on phones */
@media (min-width: 768px) and (max-width: 1023px) {
  .calc-quote-side {
    display: block;
  }

  .mobile-summary-bar {
    display: none;
  }

  .calc-section {
    padding-bottom: var(--section-padding-mobile);
  }

  .custom-section {
    padding-bottom: 0;
  }
}

.mobile-summary-bar__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mobile-summary-bar__left {
  display: flex;
  flex-direction: column;
}

.mobile-summary-bar__label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 2px;
}

.mobile-summary-bar__total {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--white);
  line-height: 1.1;
}

.mobile-summary-bar__per-mo {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.5);
}

.mobile-summary-bar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-summary-toggle {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
  font-family: var(--font-heading);
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.mobile-summary-toggle:hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--white);
}

/* Expanded detail panel above the bar */
.mobile-summary-details {
  background: var(--white);
  border-top: 1px solid var(--neutral-light);
  padding: 16px 20px 4px;
  max-height: 260px;
  overflow-y: auto;
}

/* ===== 8. Scheduler modal ================================================== */

/*
 * The modal uses [hidden] to toggle visibility in JS.
 * We must NOT put display:flex on the base rule — doing so overrides the
 * browser's [hidden]{display:none} UA stylesheet, making the modal appear
 * immediately on page load. Instead, display:flex only applies when [hidden]
 * is absent (i.e. when the modal is intentionally open).
 */
.scheduler-modal {
  position: fixed;
  inset: 0;
  z-index: 1100; /* must exceed the site header's z-index: 1000 */
  /* display is intentionally omitted here — see :not([hidden]) below */
  align-items: flex-start;
  justify-content: center;
  background: rgba(12, 21, 40, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  padding: 16px;
  overflow-y: auto;
}

/* Only flex when the modal is actually open (hidden attr removed by JS) */
.scheduler-modal:not([hidden]) {
  display: flex;
}

body.modal-open {
  overflow: hidden;
}

.scheduler-modal__inner {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  box-shadow: 0 24px 80px rgba(12, 21, 40, 0.25);
  overflow: hidden;
  margin: auto;
  position: relative;
}

.scheduler-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--neutral-light);
}

.scheduler-modal__title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--navy-primary);
  margin: 0;
}

.scheduler-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--neutral-offwhite);
  border: none;
  cursor: pointer;
  color: var(--accent-steel);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.scheduler-modal__close:hover {
  background: var(--neutral-light);
  color: var(--navy-primary);
}

.scheduler-modal__close svg {
  width: 18px;
  height: 18px;
}

.scheduler-modal__body {
  padding: 28px;
}

/* Optional lead form inside the modal */
.scheduler-lead-form {
  margin-bottom: 28px;
}

.scheduler-lead-form__title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--navy-primary);
  margin-bottom: 4px;
}

.scheduler-lead-form__sub {
  font-size: 0.88rem;
  color: var(--accent-steel);
  margin-bottom: 20px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 560px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

.scheduler-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--accent-steel);
  font-size: 0.85rem;
}

.scheduler-divider::before,
.scheduler-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--neutral-light);
}

.scheduler-zoom-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--navy-primary);
  margin-bottom: 4px;
}

.scheduler-zoom-sub {
  font-size: 0.88rem;
  color: var(--accent-steel);
  margin-bottom: 16px;
}

.scheduler-zoom-wrap {
  border-radius: var(--radius-md);
  overflow: hidden;
  /* Center the iframe when it is narrower than the container */
  display: flex;
  justify-content: center;
}

/*
 * Zoom's scheduler goes single-column (calendar stacked above time slots)
 * when its container is roughly 480 px wide or less. Keeping it at that
 * cap means the widget never splits into the awkward two-panel layout.
 * Height is set taller to give the stacked single-column layout room to
 * breathe (calendar + times + confirm step all fit without inner scroll).
 */
.scheduler-zoom-wrap iframe {
  display: block;
  width: 100%;
  max-width: 480px;
  height: 700px;
  border: 0;
  background: #ffffff;
}

@media (max-width: 600px) {
  .scheduler-zoom-wrap iframe {
    height: 700px;
  }

  .scheduler-modal__body {
    padding: 20px;
  }

  .scheduler-modal__header {
    padding: 20px 20px 16px;
  }
}

/* ===== 9. Section 2 — custom plan CTA ===================================== */

.custom-section {
  padding: var(--section-padding) 0;
  background: var(--white);
}

@media (max-width: 768px) {
  .custom-section {
    padding: var(--section-padding-mobile) 0;
  }
}

.custom-cta-card {
  max-width: 720px;
  margin: 0 auto;
  background: var(--neutral-offwhite);
  border: 1px solid var(--neutral-light);
  border-radius: var(--radius-xl);
  padding: 52px 48px;
  text-align: center;
}

.custom-cta-card__eyebrow {
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: 0.82rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent-steel);
  margin-bottom: 16px;
}

.custom-cta-card__title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--navy-primary);
  margin-bottom: 16px;
  line-height: 1.2;
}

.custom-cta-card__body {
  font-size: 1.05rem;
  color: var(--accent-steel);
  max-width: 520px;
  margin: 0 auto 32px;
  line-height: 1.8;
}

@media (max-width: 640px) {
  .custom-cta-card {
    padding: 36px 24px;
  }
}

/* ===== 10. Mobile polish =================================================== */

@media (max-width: 559px) {
  .calc-form-card,
  .calc-quote-card {
    padding: 24px 20px;
  }

  .level-cards {
    grid-template-columns: 1fr;
  }

  .level-card__name {
    font-size: 1rem;
  }
}

@media (max-width: 400px) {
  .stepper__input {
    font-size: 1rem;
  }
}
