@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700;800&display=swap');

:root {
  --hi-navy: #0a3454;
  --hi-navy-dark: #062238;
  --hi-green: #84d3aa;
  --hi-green-dark: #5fbf8f;
  --hi-text: #0a3454;
  --hi-muted: #5a7085;
  --hi-border: #d8e8df;
  --hi-info-bg: #eef8f2;
  --trial-bg: #0b0b0b;
  --trial-line: rgba(255, 255, 255, 0.92);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #e8ecef;
  font-family: 'Montserrat', system-ui, sans-serif;
  color: #0a3454;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.pub-page-wrap {
  padding: 20px 16px 48px;
  display: flex;
  justify-content: center;
}

.pub-print-stack {
  width: 100%;
  max-width: 860px;
  display: flex;
  justify-content: center;
}

.pub-action-bar {
  position: relative;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
  color: #e5eef7;
  border-bottom: 1px solid rgba(132, 211, 170, 0.25);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
}

.pub-action-bar__main {
  flex: 1 1 640px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.pub-action-bar__eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hi-green);
  font-weight: 700;
}

.pub-action-bar__title {
  margin: 2px 0 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}

.pub-action-bar__hint {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: rgba(226, 232, 240, 0.78);
  max-width: 52rem;
  line-height: 1.35;
}

.pub-slots {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.pub-slot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pub-slot__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.7);
}

.pub-slot__select,
.pub-action-bar__input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.65);
  color: #f8fafc;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.82rem;
}

.pub-slot__select:focus,
.pub-action-bar__input:focus {
  outline: 2px solid rgba(132, 211, 170, 0.55);
  outline-offset: 1px;
}

.pub-action-bar__group--fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.pub-action-bar__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pub-action-bar__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.7);
}

.pub-action-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pub-action-bar__btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--hi-green);
  color: #062238;
}

.pub-action-bar__btn--ghost {
  background: transparent;
  color: #e2e8f0;
  border: 1px solid rgba(226, 232, 240, 0.35);
}

.pub-slot.is-active .pub-slot__select {
  border-color: var(--hi-green);
  box-shadow: 0 0 0 1px rgba(132, 211, 170, 0.35);
}


/* Mode toggle (5 por página vs 1 página / tenant) */
.pub-mode-toggle {
  display: inline-flex;
  gap: 6px;
  margin-top: 10px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(132, 211, 170, 0.28);
}
.pub-mode-toggle__btn {
  appearance: none;
  border: 0;
  text-decoration: none;
  color: rgba(226, 232, 240, 0.82);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.pub-mode-toggle__btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.pub-mode-toggle__btn.is-active {
  color: #062238;
  background: var(--hi-green);
}

.pub-action-bar__select {
  min-width: min(100%, 320px);
  max-width: 420px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #0b1220;
  color: #e2e8f0;
  font: inherit;
}


.pub-print-stack[data-mode="pages"] {
  max-width: 210mm;
  justify-content: center;
}

/* A4: 5 vertical strips — horizontal ticket rotated 90° (Versión TRIAL.pdf) */
.pub-trial-sheet {
  width: min(100%, 794px);
  aspect-ratio: 210 / 297;
  height: auto;
  background: var(--trial-bg);
  color: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.pub-trial-sheet__grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.pub-trial-strip {
  position: relative;
  overflow: hidden;
  min-width: 0;
  border-left: 1px solid var(--trial-line);
  background: var(--trial-bg);
  cursor: pointer;
}

.pub-trial-strip:first-child {
  border-left: 0;
}

.pub-trial-strip.is-active {
  outline: 2px solid var(--hi-green);
  outline-offset: -2px;
  z-index: 2;
}

.pub-trial-strip__rotator {
  position: absolute;
  inset: 0;
}

.pub-trial-strip__ticket {
  position: absolute;
  /* Centered in top half; JS sets precise px. Bottom 50% stays empty. */
  top: 25%;
  left: 50%;
  display: grid;
  grid-template-columns: 1.05fr 1.95fr;
  align-items: stretch;
  transform: translate(-50%, -50%) rotate(90deg);
  transform-origin: center center;
  background: var(--trial-bg);
  color: #fff;
  /* Default = half strip height × strip width (print overrides) */
  width: 148.5mm;
  height: 42mm;
}

.pub-trial-strip__badge {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.4em;
  padding: 0.3em 0.4em;
  color: var(--hi-green);
  border-right: 1px solid rgba(132, 211, 170, 0.4);
  min-width: 0;
}

.pub-trial-strip__qr {
  width: 3.35em;
  height: 3.35em;
  object-fit: contain;
  background: #fff;
  border-radius: 0.18em;
  padding: 0.12em;
  display: block;
  flex: 0 0 auto;
}

.pub-trial-strip.is-empty .pub-trial-strip__qr {
  opacity: 0.2;
  filter: grayscale(1);
}

.pub-trial-strip__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.28em;
  min-width: 0;
}

.pub-trial-strip__mark {
  width: 1.35em;
  height: 1.35em;
  display: block;
  color: var(--hi-green);
}

.pub-trial-strip__badge-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12em;
}

.pub-trial-strip__hours,
.pub-trial-strip__demo {
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  color: var(--hi-green);
}

.pub-trial-strip__demo { font-size: 1.35em; }
.pub-trial-strip__hours { font-size: 1.05em; }

.pub-trial-strip__fields {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.45em;
  padding: 0.45em 0.7em 0.45em 0.55em;
  min-width: 0;
}

.pub-trial-field {
  display: grid;
  grid-template-columns: 7.5em minmax(0, 1fr);
  gap: 0.45em;
  align-items: center;
  min-width: 0;
}

.pub-trial-field__lab {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  color: #ffffff;
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pub-trial-field__lab svg {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  opacity: 0.95;
}

.pub-trial-field__val {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  padding: 0.32em 0.65em;
  font-size: 0.78em;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #ffffff !important;
  background: transparent;
}

.pub-trial-strip__empty-hint {
  display: none;
}

.pub-trial-strip.is-empty .pub-trial-strip__fields,
.pub-trial-strip.is-empty .pub-trial-strip__badge {
  opacity: 0.22;
}

.pub-trial-strip.is-empty .pub-trial-strip__empty-hint {
  display: flex;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  font-size: 0.85em;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  transform: rotate(-90deg);
  white-space: nowrap;
}

@media screen and (max-width: 980px) {
  .pub-slots { grid-template-columns: 1fr 1fr; }
  .pub-action-bar__group--fields { grid-template-columns: 1fr; }
}

@media screen and (max-width: 720px) {
  .pub-slots { grid-template-columns: 1fr; }
  .pub-action-bar { flex-direction: column; }
  .pub-action-bar__actions { width: 100%; }
  .pub-action-bar__btn { flex: 1; }
}

@media print {
  body { background: #000 !important; }
  body:has(.pub-print-stack[data-mode="pages"]) {
    background: #fff !important;
  }

  .pub-action-bar { display: none !important; }

  body.master-publicidade-folha-page .content {
    padding: 0 !important;
    overflow: visible !important;
  }

  .master-publicidade-folha-shell {
    background: #000 !important;
    min-height: 0 !important;
  }
  body:has(.pub-print-stack[data-mode="pages"]) .master-publicidade-folha-shell {
    background: #fff !important;
  }

  .pub-page-wrap {
    padding: 0 !important;
    margin: 0 !important;
  }

  .pub-print-stack {
    max-width: none;
    width: 210mm;
    margin: 0;
  }

  .pub-trial-sheet {
    width: 210mm;
    height: 297mm;
    aspect-ratio: auto;
    box-shadow: none;
  }

  .pub-trial-strip.is-active { outline: none; }

  .pub-trial-strip__ticket {
    width: 148.5mm !important; /* top 50% of 297mm strip */
    height: 42mm !important; /* 210mm / 5 */
    top: 25% !important;
    left: 50% !important;
    font-size: 15px !important;
  }


  /* pages mode: one A4 flyer per tenant */
  .pub-print-stack[data-mode="pages"] {
    width: 100%;
    max-width: none;
    background: #fff;
  }

  .pub-print-stack[data-mode="pages"] .pub-a4 {
    display: none;
    box-shadow: none;
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    page-break-after: always;
    break-after: page;
  }

  .pub-print-stack[data-mode="pages"] .pub-a4.is-active {
    display: flex;
  }

  body.pub-print-all .pub-print-stack[data-mode="pages"] .pub-a4 {
    display: flex !important;
  }

  .pub-print-stack[data-mode="pages"] .pub-a4:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  body.pub-print-all,
  body.pub-print-all .master-publicidade-folha-shell,
  .pub-print-stack[data-mode="pages"] {
    background: #fff !important;
  }

  @page {
    size: A4 portrait;
    margin: 0;
  }
}

/* ===== Single-page trial flyer (1 A4 / tenant) ===== */
.pub-print-stack .pub-a4 {
  display: none;
}

.pub-print-stack .pub-a4.is-active {
  display: flex;
}

.pub-a4 {
  position: relative;
  width: 210mm;
  min-height: 297mm;
  background: #fff;
  box-shadow: 0 8px 40px rgba(10, 52, 84, 0.12);
  overflow: hidden;
  padding: 14mm 16mm 12mm;
  display: flex;
  flex-direction: column;
}

.pub-a4::before,
.pub-a4::after {
  content: '';
  position: absolute;
  pointer-events: none;
  opacity: 0.35;
}

.pub-a4::before {
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, transparent 50%, rgba(132, 211, 170, 0.25) 50%);
}

.pub-a4::after {
  bottom: 18mm;
  left: 0;
  width: 80px;
  height: 80px;
  border-left: 2px solid rgba(132, 211, 170, 0.35);
  border-bottom: 2px solid rgba(132, 211, 170, 0.35);
}

/* ── Header ── */
.pub-header {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 8mm;
  align-items: start;
  margin-bottom: 8mm;
}

.pub-header__left {
  padding-top: 2mm;
}

.pub-logo-mark {
  width: 42px;
  height: 42px;
  margin-bottom: 6mm;
}

.pub-tenant-logo {
  display: flex;
  align-items: center;
  margin-bottom: 5mm;
  max-width: 72mm;
  min-height: 14mm;
}

.pub-tenant-logo img {
  display: block;
  max-width: 100%;
  max-height: 22mm;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: left center;
}

.pub-headline {
  margin: 0;
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.pub-headline span {
  display: block;
  font-weight: 800;
  font-size: 13.5mm;
  text-transform: uppercase;
}

.pub-headline .is-green {
  color: var(--hi-green-dark);
  font-size: 15mm;
}

.pub-headline .is-navy {
  color: var(--hi-navy);
}

.pub-headline-accent {
  display: block;
  width: 18mm;
  height: 1.2mm;
  background: var(--hi-green);
  margin-top: 3mm;
}

.pub-mockup {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.pub-mockup img,
.pub-mockup-svg {
  width: 100%;
  max-width: 98mm;
  height: auto;
  object-fit: contain;
  margin-right: -4mm;
  margin-top: -2mm;
}

.pub-mockup img {
  display: block;
}

/* ── Access box ── */
.pub-access {
  display: grid;
  grid-template-columns: 28mm 1fr;
  background: var(--hi-navy-dark);
  border-radius: 5mm;
  overflow: hidden;
  margin-bottom: 7mm;
}

.pub-access__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5mm 3mm;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  gap: 2mm;
}

.pub-access__lock {
  width: 14mm;
  height: 14mm;
  border: 2px solid var(--hi-green);
  border-radius: 2.5mm;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hi-green);
}

.pub-access__lock svg {
  width: 7mm;
  height: 7mm;
}

.pub-access__label {
  color: var(--hi-green);
  font-weight: 700;
  font-size: 3.2mm;
  letter-spacing: 0.08em;
}

.pub-access__fields {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3mm;
  padding: 5mm 6mm;
}

.pub-field {
  display: grid;
  grid-template-columns: 22mm 1fr;
  align-items: center;
  gap: 3mm;
}

.pub-field__meta {
  display: flex;
  align-items: center;
  gap: 2mm;
  color: #fff;
  font-size: 2.6mm;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.pub-field__meta svg {
  width: 4mm;
  height: 4mm;
  flex-shrink: 0;
  color: var(--hi-green);
}

.pub-field__value {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(132, 211, 170, 0.45);
  border-radius: 1.5mm;
  color: #fff;
  font-size: 3mm;
  font-weight: 500;
  padding: 2mm 3mm;
  word-break: break-all;
}

/* ── Features ── */
.pub-features {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  margin-bottom: 7mm;
  padding: 0 1mm;
}

.pub-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2mm;
  padding: 0 1.5mm;
  position: relative;
}

.pub-feature:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 15%;
  height: 70%;
  width: 1px;
  background: #dde5ea;
}

.pub-feature svg {
  width: 7mm;
  height: 7mm;
  color: var(--hi-navy);
}

.pub-feature span {
  font-size: 2.3mm;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: var(--hi-navy);
}

/* ── Info box ── */
.pub-info {
  display: grid;
  grid-template-columns: 16mm 1fr 22mm;
  align-items: center;
  gap: 4mm;
  background: var(--hi-info-bg);
  border: 1px solid var(--hi-border);
  border-radius: 4mm;
  padding: 4mm 5mm;
  margin-bottom: auto;
}

.pub-info__icon {
  color: var(--hi-green-dark);
}

.pub-info__icon svg {
  width: 12mm;
  height: 12mm;
}

.pub-info__text {
  margin: 0;
  font-size: 3.2mm;
  line-height: 1.45;
  color: var(--hi-muted);
}

.pub-info__text strong {
  color: var(--hi-green-dark);
  font-weight: 800;
}

.pub-info__qr-wrap {
  justify-self: end;
}

.pub-info__qr {
  position: relative;
  display: block;
  width: 22mm;
  height: 22mm;
  border-radius: 1.5mm;
  background: #fff;
  padding: 0.8mm;
  border: 1px solid var(--hi-border);
  overflow: hidden;
  line-height: 0;
}

.pub-info__qr img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.pub-info__qr-mark {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 5.2mm;
  height: 5.2mm;
  border-radius: 0.8mm;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 0.6mm #fff;
}

.pub-info__qr-mark svg {
  width: 3.6mm;
  height: 3.6mm;
  display: block;
}

/* ── Flyer footer ── */
.pub-footer {
  margin-top: 8mm;
  padding-top: 5mm;
  border-top: 1px solid #e8edf1;
  display: flex;
  justify-content: center;
}
.pub-footer img {
  height: 9mm;
  width: auto;
}
@media print {
  .pub-info__qr {
    color: inherit;
    text-decoration: none;
  }
}

