// Visitor design layer (S13 light restyle, refreshed in S13b to the dev mockup). Loaded last in style.scss.
// Same structure, fields, selectors and flows; typography, colour, surfaces and states only.

// ---------- Base ----------
body {
  font-family: var(--z-font) !important;
  color: var(--z-ink-2);
  background:
    radial-gradient(1100px 480px at 12% -8%, #dbe7fb 0, rgba(219, 231, 251, 0) 62%),
    radial-gradient(900px 420px at 92% -4%, #e6eefc 0, rgba(230, 238, 252, 0) 60%),
    var(--z-canvas);
  background-attachment: fixed;
  word-spacing: 0.06em;
  -webkit-font-smoothing: antialiased;
}

main,
#tab2,
#tab_section,
.do-wizard-header {
  background: transparent;
}

// Header: the name left, "For internal use only" as a pill right.
header {
  position: relative;
}

header nav.bg-lightgray {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--z-line);
  padding: 12px 0;
}

.z-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

header small.z-pill {
  opacity: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--z-ink-2);
  background: var(--z-surface-2);
  border: 1px solid var(--z-line);
  border-radius: 999px;
  padding: 5px 12px;
}

.tab-content .tab-pane {
  padding-top: 0;
  min-height: calc(100vh - 62px);
}

.do-wizard-header h3 {
  font-size: 24px;
  font-weight: 800;
  color: var(--z-ink);
  letter-spacing: -0.01em;
}

// ---------- Controls ----------
.btn {
  border-radius: var(--z-radius-sm);
  font-weight: 600;
  transition: background-color 0.15s var(--z-ease), border-color 0.15s var(--z-ease), box-shadow 0.15s var(--z-ease), color 0.15s var(--z-ease), transform 0.15s var(--z-ease);
}

.btn-lg {
  border-radius: var(--z-radius);
  font-size: 15px;
  padding: 10px 22px;
}

.btn-primary {
  background-color: var(--z-primary);
  border-color: var(--z-primary);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:not(:disabled):not(.disabled):active {
  background-color: var(--z-primary-hover);
  border-color: var(--z-primary-hover);
}

.btn:focus,
.btn.focus,
.btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled):active:focus {
  box-shadow: none;
}

.btn:focus-visible,
button:focus-visible,
.form-control:focus,
.selectize-input.focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--z-primary-ring) !important;
}

.form-control {
  border-color: var(--z-line-strong);
  border-radius: var(--z-radius-sm);
  color: var(--z-ink);
}

.form-control:focus {
  border-color: var(--z-primary);
}

.form-control::placeholder {
  color: var(--z-ink-3);
  opacity: 1;
}

.input-group-text {
  background: var(--z-surface-2);
  border-color: var(--z-line-strong);
  color: var(--z-ink-3);
  font-size: 12px;
  font-weight: 600;
}

// Back arrows: round white buttons.
.do-back-arrow,
.do-products-header .do-back-arrow,
#tab2 .do-back-arrow {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--z-surface);
  border: 1px solid var(--z-line);
  border-radius: 50%;
  box-shadow: var(--z-shadow-xs);
}

.do-back-arrow img {
  width: 18px;
  height: 18px;
}

.do-back-arrow:hover {
  background: var(--z-surface);
  border-color: var(--z-primary-soft);
  box-shadow: var(--z-shadow-raise);
}

// ---------- Step 1: access code ----------
.z-access {
  max-width: 460px;
  margin: 13vh auto 0;
  padding: 0 16px;
  text-align: center;
}

.z-access__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: var(--z-primary);
  background: var(--z-primary-tint);
  border: 4px solid #fff;
  box-shadow: var(--z-shadow-card);
}

.z-access__icon svg {
  width: 24px;
  height: 24px;
}

.z-access__title {
  margin: 18px 0 6px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--z-ink);
}

.z-access__lead {
  margin: 0;
  font-size: 15px;
  color: var(--z-ink-3);
}

.z-access__form {
  display: flex;
  gap: 8px;
  margin-top: 24px;
  padding: 6px;
  background: var(--z-surface);
  border: 1px solid var(--z-line);
  border-radius: 12px;
  box-shadow: var(--z-shadow-card);
}

.z-access__form .input-group {
  position: relative;
  flex: 1;
}

.z-access__key {
  position: absolute;
  top: 50%;
  left: 12px;
  z-index: 4;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  color: var(--z-ink-3);
  pointer-events: none;
}

.z-access__key svg {
  display: block;
  width: 18px;
  height: 18px;
}

#tab1 #code {
  height: 44px;
  padding: 0 14px 0 40px;
  font-size: 15px;
  border-color: transparent;
  border-radius: var(--z-radius-sm) !important;
}

#tab1 #code:focus {
  border-color: var(--z-primary);
}

#tab1 #validate-code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 700;
}

#tab1 #validate-code svg {
  width: 16px;
  height: 16px;
}

#tab1 #validate-code:hover svg {
  transform: translateX(2px);
  transition: transform 0.15s var(--z-ease);
}

// ---------- Section and market tiles ----------
#tab_section .custom-radio .btn-outline-dark,
#tab2 .custom-radio .btn-outline-dark {
  background: var(--z-surface);
  color: var(--z-ink);
  font-weight: 700;
  border: 1px solid var(--z-line);
  border-radius: var(--z-radius-lg);
  box-shadow: var(--z-shadow-card);
}

#tab_section .custom-radio .btn-outline-dark:hover,
#tab2 .custom-radio .btn-outline-dark:hover {
  background: var(--z-surface);
  color: var(--z-primary);
  border-color: var(--z-primary-soft);
  box-shadow: var(--z-shadow-raise);
  transform: translateY(-2px);
}

#tab_section .custom-radio .btn-outline-dark:active,
#tab2 .custom-radio .btn-outline-dark:active {
  transform: translateY(0);
  box-shadow: var(--z-shadow-card);
}

.do-market-menu button:hover img,
.do-selected-market button:hover img,
.do-selected-market button.disabled img {
  filter: none;
}

// ---------- Step: product list ----------
.do-product-filter h4 {
  font-size: 18px;
  font-weight: 800;
  color: var(--z-ink);
}

.do-product-filter .selectize-input {
  border: 1px solid var(--z-line-strong);
  border-radius: var(--z-radius);
  box-shadow: var(--z-shadow-xs);
  background-color: var(--z-surface);
}

.do-product-list li {
  padding: 10px;
}

.do-product-list li span {
  border: 1px solid var(--z-line);
  border-radius: var(--z-radius);
  padding: 15px 60px 15px 16px;
  font-size: 13px;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--z-ink);
  box-shadow: var(--z-shadow-xs);
  transition: border-color 0.15s var(--z-ease), box-shadow 0.15s var(--z-ease);
}

.do-product-list li span::after,
.do-product-list li span::before {
  width: 46px;
  border-radius: 0 var(--z-radius) var(--z-radius) 0;
}

.do-product-list li span::after {
  background: var(--z-primary);
}

.do-product-list li span::before {
  background-size: 20px;
}

.do-product-list li:hover span {
  border-color: var(--z-primary-soft);
  box-shadow: var(--z-shadow-raise);
}

// ---------- Step: compare desk ----------
#tab4 .do-wizard-header {
  padding: 8px 24px 0;
}

#tab4 .do-wizard-header h3 {
  margin-top: 24px;
  font-size: 22px;
}

.do-selected-market button {
  margin: 6px 4px;
  padding: 7px 34px 7px 12px;
  position: relative;
  background: var(--z-surface);
  color: var(--z-ink);
  font-size: 14px;
  font-weight: 700;
  border: 1px solid var(--z-line);
  border-radius: var(--z-radius);
  box-shadow: var(--z-shadow-xs);
}

.do-selected-market button::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -5px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.7;
}

.do-selected-market button:hover {
  background: var(--z-surface);
  color: var(--z-primary);
  border-color: var(--z-primary-soft);
}

.do-selected-market button.disabled {
  background: var(--z-surface);
  border-color: var(--z-line);
  color: var(--z-ink);
}

.do-selected-market button img {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: cover;
}

// Summary + report card (Calculate Margin, totals and the chart).
.do-summary-wrap {
  bottom: 0;
  margin: 16px 0 28px;
  padding: 20px 24px;
  background: var(--z-surface);
  border: 1px solid var(--z-line);
  border-radius: var(--z-radius-lg);
  box-shadow: var(--z-shadow-card);
}

.do-summary-wrap .do-get-summary .do-qrow {
  font-size: 12px;
  color: var(--z-ink-3);
}

.do-summary-wrap .do-get-summary .do-qrow .do-qrow-sum,
.do-final-report .do-qrow .do-qrow-sum {
  background: var(--z-surface-2);
  border: 1px solid var(--z-line);
  border-radius: var(--z-radius-sm);
  color: var(--z-ink);
  font-size: 14px;
  font-weight: 700;
  padding: 6px 12px;
}

.do-final-report {
  padding: 4px 0;
}

#tab4 .do-final-report h3 {
  width: auto;
  height: auto;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--z-ink);
}

.do-final-report .do-qrow label {
  font-size: 12px;
  font-weight: 600;
  color: var(--z-ink-3);
  margin-bottom: 6px;
}

.do-final-report .do-qrow .do-qrow-margin,
.do-final-report .do-qrow .do-currency {
  font-size: 24px;
  font-weight: 800;
  color: var(--z-ink);
  letter-spacing: -0.01em;
}

.do-product .do-margin-show .do-total-margin-price,
.do-summary-wrap .do-qrow-sum,
.do-final-report .do-qrow-sum,
.do-final-report .do-qrow-margin,
.do-product .do-total-m,
.do-product .do-unit-m {
  font-variant-numeric: tabular-nums;
}

// Compact chart, as in the mockup (Highcharts takes the container height).
#chart_report {
  height: 280px;
}

.highcharts-root,
.highcharts-root text {
  font-family: var(--z-font) !important;
}

// "Compare" toolbar.
#tab4 .do-wizard-header > div > .row > .col-12 > h3.float-left {
  margin-top: 14px;
}

.do-desk-options {
  margin-top: 10px;
}

.do-desk-options button {
  margin: 6px 0 6px 8px;
  padding: 7px 12px;
  gap: 6px;
  background: var(--z-surface);
  color: var(--z-ink-2);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--z-line);
  border-radius: var(--z-radius-sm);
  box-shadow: var(--z-shadow-xs);
}

.do-desk-options button img {
  width: 16px;
  height: 16px;
  margin-right: 0;
}

.do-desk-options button:hover {
  background: var(--z-primary-tint);
  color: var(--z-primary);
  border-color: var(--z-primary-soft);
}

.do-wizard-body {
  padding-top: 8px;
}

.do-selected-products {
  padding: 8px 16px 24px;
}

// Pack cards.
.do-product {
  padding: 8px;
}

.do-product .card {
  border: 1px solid var(--z-line);
  border-radius: var(--z-radius-lg);
  box-shadow: var(--z-shadow-card);
}

.do-product .card-header {
  padding: 12px 8px 12px 16px;
  border-radius: var(--z-radius-lg) var(--z-radius-lg) 0 0;
  border-bottom: 1px solid var(--z-line);
}

.do-product .card-header h4 {
  height: auto;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--z-ink);
}

.do-product .card-header .do-product-delete {
  width: 32px;
  height: 32px;
  border-radius: var(--z-radius-sm);
}

.do-product .card-header .do-product-delete img {
  width: 16px;
  height: 16px;
  opacity: 0.75;
}

.do-product .card-header .do-product-delete:hover {
  background: var(--z-danger-tint);
  box-shadow: none;
}

.do-product .card hr {
  border-top: 1px solid var(--z-line);
  margin: 0;
}

.do-product .do-package-select,
.do-product .do-prices {
  padding: 12px 16px 4px;
}

.do-product select.form-control,
.do-product .form-control {
  height: 36px;
  font-size: 13px;
}

.do-product .do-quantities li,
.do-product .do-quantities li:nth-child(2n) {
  background: var(--z-surface);
  padding: 6px 16px;
}

.do-product .do-quantity-block .form-group {
  margin-bottom: 4px;
}

.do-product .do-package-select {
  margin-bottom: 0;
  padding-bottom: 8px;
}

.do-product .row.gutters-sm > div {
  padding: 2px 5px;
}

.do-product .do-quantity-block .form-group label,
.do-product .do-device-prices label {
  font-size: 12px;
  font-weight: 600;
  color: var(--z-ink-3);
}

.do-product .do-err {
  font-size: 12px;
  font-weight: 700;
  color: var(--z-danger);
  margin-top: 4px;
}

// Add Pack: rounded primary button inside the card.
.do-add-segment {
  padding: 4px 12px 8px;
}

.do-product-add,
.do-product .do-product-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--z-radius-sm);
}

.do-product-add span {
  position: static;
  transform: none;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.do-product-add:hover {
  background: var(--z-primary-hover);
}

// Totals under each card.
.do-product .do-margin-show {
  width: 100%;
  padding: 0 16px 10px;
  font-size: 13px;
  color: var(--z-ink);
}

.do-product .do-margin-show p {
  margin: 8px 0 0;
  line-height: 1.4;
}

.do-product .do-margin-show .do-total-margin-price {
  font-size: 15px;
  font-weight: 800;
}

.do-product .do-margin-show .do-show-formula {
  font-size: 12px;
  font-weight: 600;
  color: var(--z-primary);
  text-underline-offset: 2px;
}

.do-product .do-margin-show .do-show-formula:hover {
  color: var(--z-primary-hover);
}

.do-product .do-quantity-block #formula,
.formula {
  font-size: 13px;
  line-height: 1.5;
  color: var(--z-danger);
}

// "+" card that adds another product.
.do-add-new {
  margin: 8px 16px 8px 0;
  background: rgba(255, 255, 255, 0.55);
  border: 1.5px dashed var(--z-line-strong);
  border-radius: var(--z-radius-lg);
  transition: border-color 0.15s var(--z-ease), background-color 0.15s var(--z-ease);
}

.do-add-new img {
  width: 32px;
  opacity: 0.55;
}

.do-add-new:hover {
  border-color: var(--z-primary);
  background: var(--z-primary-tint);
}

.recalc-button {
  padding-left: 24px;
}

.recalc-button button {
  letter-spacing: 0.02em;
}

// Disclaimer under each step: same words, read as a note.
.tab-content .tab-pane > strong {
  display: block;
  max-width: 72ch;
  margin: 32px auto 0;
  padding: 0 16px;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--z-ink-3);
}

// ---------- Modals ----------
.modal-content {
  border: none;
  border-radius: var(--z-radius-lg);
  box-shadow: 0 24px 56px rgba(15, 27, 45, 0.22);
}

.modal-header,
.modal-footer {
  border-color: var(--z-line);
}

.modal-title {
  font-weight: 800;
  color: var(--z-ink);
}

.modal-body {
  color: var(--z-ink-2);
}

// ---------- Small screens ----------
@media screen and (max-width: 576px) {
  .z-access {
    margin-top: 8vh;
  }

  .z-access__title {
    font-size: 24px;
  }

  header small.z-pill {
    font-size: 11px;
    padding: 4px 10px;
  }

  #tab_section .custom-radio .btn-outline-dark,
  #tab2 .custom-radio .btn-outline-dark {
    padding: 56px 24px 48px 24px;
  }

  .do-wizard-header {
    padding: 16px;
  }

  #tab4 .do-wizard-header {
    padding: 8px 12px 0;
  }

  .do-summary-wrap {
    padding: 16px;
  }
}
