/**
 * Scan and Sign - QR sign-up forms for events
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Commercial License
 * you can't distribute, modify or sell this code
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file
 * If you need help please contact leo@prestachamps.com
 *
 * @author    PrestaChamps
 * @copyright PrestaChamps
 * @license   commercial
 */

/*
 * Storefront form of Scan and Sign: the stand-alone page, the kiosk, the shortcode block on any theme page and the
 * printable poster. Mobile first, 16 px gutters, 48 px tap targets. Colours come from the per-form CSS variables
 * (css.tpl); every use has a fallback. Everything is namespaced under .pchss-; selectors inside the block are
 * doubled so that common theme rules on inputs and buttons do not win.
 */

/* ---------- Block ---------- */
.pchss-block {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--pchss-max-width, 640px);
  margin: 0 auto;
  padding: 24px 16px;
  background: var(--pchss-bg, #ffffff);
  color: var(--pchss-text, #1f2937);
  font-family: var(--pchss-font, inherit);
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
  border-radius: var(--pchss-radius, 8px);
  -webkit-text-size-adjust: 100%;
}

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

.pchss-block [hidden],
.pchss-page [hidden] {
  display: none !important;
}

.pchss-block .pchss-title {
  margin: 0 0 8px;
  padding: 0;
  color: inherit;
  font-family: inherit;
  font-size: 1.5em;
  font-weight: 700;
  line-height: 1.25;
  text-transform: none;
  letter-spacing: normal;
}

.pchss-block .pchss-description {
  margin: 0 0 16px;
  color: inherit;
  white-space: pre-line;
}

.pchss-block .pchss-general-error,
.pchss-block .pchss-error {
  margin: 6px 0 0;
  padding: 2px 0 2px 10px;
  border-left: 3px solid #d93025;
  color: inherit;
  font-size: 0.9375em;
  font-weight: 600;
}

.pchss-block .pchss-general-error {
  margin: 0 0 16px;
}

/* ---------- Fields ---------- */
.pchss-block .pchss-fields {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  margin: 0 -8px;
}

.pchss-block .pchss-field {
  position: relative;
  -webkit-box-flex: 0;
  -ms-flex: 0 0 100%;
  flex: 0 0 100%;
  max-width: 100%;
  margin: 0 0 16px;
  padding: 0 8px;
}

@media (min-width: 560px) {
  .pchss-block .pchss-w-half {
    -ms-flex-preferred-size: 50%;
    flex-basis: 50%;
    max-width: 50%;
  }
}

/* Themes align labels too (Classic: label { text-align: right }). */
.pchss-block label {
  text-align: left;
  text-align: start;
}

.pchss-block .pchss-label {
  display: block;
  margin: 0 0 6px;
  color: inherit;
  font-size: 0.9375em;
  font-weight: 600;
  line-height: 1.3;
}

/* Blog and CMS content styles reach every span (the blog module: .simpleblog__post__content span { display: block;
   margin-bottom: 12px }), which put the required star on its own line. Spans of the block stay inline unless one of
   its own rules says otherwise (div.pchss-block span outranks a theme's ".content span"; class rules outrank both). */
div.pchss-block span {
  display: inline;
  float: none;
  margin: 0;
}

.pchss-block .pchss-req {
  display: inline;
  margin: 0;
  color: var(--pchss-accent, #ff5a5f);
}

.pchss-block .pchss-help {
  margin: 6px 0 0;
  color: inherit;
  font-size: 0.875em;
  opacity: 0.8;
}

.pchss-block .pchss-input,
.pchss-page .pchss-input {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 12px 14px;
  color: var(--pchss-text, #1f2937);
  background-color: var(--pchss-bg, #ffffff);
  border: 1px solid var(--pchss-border, #d1d5db);
  border-radius: var(--pchss-radius, 8px);
  box-shadow: none;
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.pchss-block textarea.pchss-input {
  min-height: 112px;
  resize: vertical;
}

.pchss-block .pchss-select {
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.pchss-block .pchss-input::-webkit-input-placeholder {
  color: inherit;
  opacity: 0.55;
}

.pchss-block .pchss-input::placeholder {
  color: inherit;
  opacity: 0.55;
}

.pchss-block .pchss-input:focus,
.pchss-page .pchss-input:focus {
  outline: none;
  border-color: var(--pchss-accent, #ff5a5f);
  box-shadow: 0 0 0 3px var(--pchss-accent, #ff5a5f);
}

.pchss-block .pchss-invalid .pchss-input {
  border-color: #d93025;
  border-width: 2px;
}

/* Label inside the field (design label_style = inside) */
.pchss-labels-inside .pchss-field:not(.pchss-field-checkbox) .pchss-label {
  position: absolute;
  z-index: 1;
  top: 7px;
  left: 23px;
  right: 23px;
  margin: 0;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
  opacity: 0.85;
  pointer-events: none;
}

.pchss-labels-inside .pchss-field:not(.pchss-field-checkbox) .pchss-input {
  min-height: 56px;
  padding-top: 25px;
  padding-bottom: 8px;
}

/* Checkbox: 24 px box, the whole row is a 48 px target */
.pchss-block .pchss-check {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: start;
  -ms-flex-align: start;
  align-items: flex-start;
  min-height: 48px;
  padding: 12px 0 0;
}

.pchss-block .pchss-checkbox {
  -ms-flex-negative: 0;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin: 0 12px 0 0;
  accent-color: var(--pchss-primary, #2e2a8f);
  cursor: pointer;
}

.pchss-block .pchss-checkbox:focus-visible {
  outline: 3px solid var(--pchss-accent, #ff5a5f);
  outline-offset: 2px;
}

.pchss-block .pchss-check-label {
  margin: 0;
  color: inherit;
  font-weight: 400;
  line-height: 1.5;
  cursor: pointer;
}

/* Honeypot: off screen, never focusable */
.pchss-block .pchss-hp {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* ---------- Buttons and links ---------- */
.pchss-block .pchss-submit,
.pchss-page .pchss-submit,
.pchss-poster-page .pchss-submit {
  display: -webkit-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin: 8px 0 0;
  padding: 12px 24px;
  color: var(--pchss-on-primary, #ffffff);
  background: var(--pchss-primary, #2e2a8f);
  border: 0;
  border-radius: var(--pchss-radius, 8px);
  box-shadow: none;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.pchss-block .pchss-submit:hover,
.pchss-page .pchss-submit:hover {
  -webkit-filter: brightness(1.08);
  filter: brightness(1.08);
}

.pchss-block .pchss-submit[disabled],
.pchss-page .pchss-submit[disabled] {
  cursor: default;
  opacity: 0.6;
  -webkit-filter: none;
  filter: none;
}

.pchss-block .pchss-submit:focus,
.pchss-page .pchss-submit:focus,
.pchss-poster-page .pchss-submit:focus {
  outline: 3px solid var(--pchss-accent, #ff5a5f);
  outline-offset: 2px;
}

.pchss-block .pchss-submit:focus:not(:focus-visible),
.pchss-page .pchss-submit:focus:not(:focus-visible) {
  outline: none;
}

.pchss-block .pchss-link,
.pchss-page .pchss-link {
  display: inline-block;
  min-height: 48px;
  margin: 0;
  padding: 12px 0;
  color: inherit;
  background: none;
  border: 0;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.pchss-block .pchss-link:focus,
.pchss-page .pchss-link:focus {
  outline: 3px solid var(--pchss-accent, #ff5a5f);
  outline-offset: 2px;
}

.pchss-block .pchss-privacy {
  margin: 0;
  font-size: 0.9375em;
}

/* ---------- Success ---------- */
/* The thank-you state sets its own text colour: a theme's rule for every <p> (Classic: grey) would win over the
   colour the block inherits, grey on the dark style's near-black. */
.pchss-block .pchss-success {
  padding: 24px 0 8px;
  color: var(--pchss-text, #1f2937);
  text-align: center;
}

.pchss-block .pchss-success-title,
.pchss-block .pchss-success-text,
.pchss-block .pchss-countdown {
  color: inherit;
}

.pchss-block .pchss-success:focus {
  outline: none;
}

.pchss-block .pchss-success-icon {
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  fill: none;
  stroke: var(--pchss-accent, #ff5a5f);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pchss-block .pchss-success-title {
  margin: 0 0 8px;
  font-size: 1.75em;
  font-weight: 700;
  line-height: 1.2;
}

.pchss-block .pchss-success-text {
  margin: 0 0 16px;
  font-size: 1.125em;
  white-space: pre-line;
}

.pchss-block .pchss-countdown {
  margin: 12px 0 0;
  font-size: 0.875em;
  opacity: 0.75;
}

/* ---------- Stand-alone page ---------- */
.pchss-page {
  margin: 0;
  min-height: 100vh;
  color: var(--pchss-text, #1f2937);
  background: var(--pchss-bg, #ffffff);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.pchss-embedded .pchss-page {
  min-height: 0;
}

.pchss-page-inner {
  box-sizing: border-box;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

.pchss-page-head {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  padding: 8px 0 8px;
}

.pchss-embedded .pchss-page-head {
  display: none;
}

.pchss-brand {
  min-height: 48px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}

.pchss-brand-link {
  color: inherit;
  text-decoration: none;
}

.pchss-brand-link:focus {
  outline: 3px solid var(--pchss-accent, #ff5a5f);
  outline-offset: 2px;
}

.pchss-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 240px;
  max-height: 64px;
}

.pchss-shop-name {
  font-size: 18px;
  font-weight: 700;
}

.pchss-noscript {
  max-width: 640px;
  margin: 0 auto 16px;
  padding: 12px 16px;
  border-left: 3px solid #d93025;
  font-weight: 600;
}

.pchss-page .pchss-block {
  padding: 8px 0 24px;
}

/* ---------- Kiosk ---------- */
.pchss-page-kiosk {
  -ms-touch-action: manipulation;
  touch-action: manipulation;
  overscroll-behavior: none;
}

.pchss-page-kiosk .pchss-brand {
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  cursor: default;
}

.pchss-page-kiosk .pchss-block {
  max-width: 760px;
  font-size: 18px;
}

.pchss-page-kiosk .pchss-input {
  min-height: 56px;
  font-size: 18px;
}

.pchss-page-kiosk .pchss-submit {
  min-height: 56px;
  font-size: 19px;
}

.pchss-phone-qr {
  width: 160px;
  margin: 16px auto 0;
  padding: 10px;
  color: #111111;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
  text-align: center;
}

.pchss-phone-qr .pchss-qr {
  display: block;
  width: 100%;
  height: auto;
}

.pchss-phone-qr-text {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.3;
}

@media (min-width: 1000px) {
  .pchss-phone-qr {
    position: fixed;
    right: 24px;
    bottom: 24px;
    margin: 0;
  }
}

/* ---------- Modals (kiosk privacy page and PIN) ---------- */
.pchss-modal {
  position: fixed;
  z-index: 1000;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.6);
}

.pchss-modal-box {
  box-sizing: border-box;
  width: 100%;
  max-width: 420px;
  max-height: 100%;
  margin: 0;
  padding: 24px 16px;
  overflow: auto;
  color: var(--pchss-text, #1f2937);
  background: var(--pchss-bg, #ffffff);
  border-radius: var(--pchss-radius, 8px);
}

.pchss-modal-wide {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -ms-flex-direction: column;
  flex-direction: column;
  max-width: 880px;
  height: 90vh;
  padding: 8px;
}

.pchss-modal-frame {
  -webkit-box-flex: 1;
  -ms-flex: 1 1 auto;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #ffffff;
  border-radius: 4px;
}

.pchss-modal-title {
  margin: 0 0 16px;
  font-size: 1.25em;
  line-height: 1.3;
}

.pchss-modal-actions {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  margin: 16px 0 0;
}

.pchss-modal-actions .pchss-submit {
  width: auto;
  margin: 0;
}

/* ---------- Poster ---------- */
.pchss-poster-page {
  margin: 0;
  color: #111111;
  background: #e5e7eb;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.pchss-poster-tools {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  padding: 16px;
}

.pchss-poster-tools .pchss-print {
  width: auto;
  margin: 0 16px 0 0;
}

.pchss-poster-sizes a {
  display: inline-block;
  min-width: 48px;
  padding: 12px 8px;
  color: inherit;
  text-align: center;
}

.pchss-poster-sizes a[aria-current] {
  font-weight: 700;
  text-decoration: none;
}

.pchss-poster {
  box-sizing: border-box;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto 24px;
  padding: 18mm 16mm;
  overflow: hidden;
  color: var(--pchss-text, #111111);
  background: var(--pchss-bg, #ffffff);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
  text-align: center;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.pchss-poster-a5 .pchss-poster {
  width: 148mm;
  min-height: 210mm;
  padding: 12mm 10mm;
}

.pchss-poster-brand {
  min-height: 18mm;
  margin: 0 0 8mm;
}

.pchss-poster-logo {
  display: block;
  max-width: 70mm;
  max-height: 22mm;
  width: auto;
  height: auto;
}

.pchss-poster-shop {
  font-size: 18pt;
  font-weight: 700;
}

.pchss-poster-title {
  margin: 0 0 8mm;
  font-size: 34pt;
  line-height: 1.15;
}

.pchss-poster-a5 .pchss-poster-title {
  font-size: 24pt;
  margin-bottom: 6mm;
}

.pchss-poster-scan {
  display: inline-block;
  margin: 0 0 10mm;
  padding: 3mm 8mm;
  color: var(--pchss-on-primary, #ffffff);
  background: var(--pchss-primary, #2e2a8f);
  border-radius: 999px;
  font-size: 20pt;
  font-weight: 700;
}

.pchss-poster-a5 .pchss-poster-scan {
  font-size: 15pt;
  margin-bottom: 7mm;
}

.pchss-poster-qr {
  width: 120mm;
  max-width: 100%;
  margin: 0 0 8mm;
  background: #ffffff;
}

.pchss-poster-a5 .pchss-poster-qr {
  width: 88mm;
}

.pchss-poster-qr .pchss-qr {
  display: block;
  width: 100%;
  height: auto;
}

.pchss-poster-url {
  margin: 0;
  font-size: 16pt;
  font-weight: 600;
  word-break: break-all;
}

.pchss-poster-a5 .pchss-poster-url {
  font-size: 12pt;
}

@media screen and (max-width: 840px) {
  .pchss-poster,
  .pchss-poster-a5 .pchss-poster {
    width: auto;
    min-height: 0;
    margin: 0 16px 24px;
    padding: 24px 16px;
  }
}

@media print {
  .pchss-poster-page {
    background: #ffffff;
  }

  .pchss-poster-tools {
    display: none !important;
  }

  .pchss-poster {
    width: 210mm;
    height: 297mm;
    min-height: 0;
    margin: 0;
    box-shadow: none;
    page-break-after: avoid;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .pchss-poster-a5 .pchss-poster {
    width: 148mm;
    height: 210mm;
  }
}
