/*
 * AcadMates Payment adaptive viewport fitter — v1.5.8
 * Keeps the approved Payment layout unchanged while fitting the complete
 * workspace into the real visible viewport on desktop and tablets.
 */

/* Remove only the outer frame's shadow/background effect. The approved
   internal cards, positions, proportions and controls are untouched. */
body .frame {
  box-shadow: none !important;
  background: transparent !important;
}

/* Desktop/tablet fitted workspace. Phones keep the approved scrolling layout. */
body.purchase-page-fit {
  overflow: hidden !important;
}

body.purchase-page-fit .site-shell {
  height: var(--purchase-visible-vh, 100dvh) !important;
  min-height: var(--purchase-visible-vh, 100dvh) !important;
  max-height: var(--purchase-visible-vh, 100dvh) !important;
  overflow: hidden !important;
}

body.purchase-page-fit .main {
  min-height: 0 !important;
  overflow: hidden !important;
}

body.purchase-page-fit .frame {
  position: relative !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden !important;
}

body.purchase-page-fit .purchase-layout {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  margin: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  transform-origin: top left !important;
  will-change: transform;
}

/* Let the fitter measure the real contents before scaling instead of clipping
   the final action row at the panel boundary. Once fitted, everything remains
   visually inside the same approved cards. */
body.purchase-page-fit .purchase-summary,
body.purchase-page-fit .purchase-form-panel,
body.purchase-page-fit .purchase-form-panel form {
  min-height: 0 !important;
  max-height: none !important;
}

/* Some Android tablets report a narrow CSS viewport and would otherwise pick
   the phone layout. This class restores the same approved two-panel Payment
   arrangement, then the JS scales it proportionally to the tablet screen. */
body.purchase-tablet-fit .purchase-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 42fr) minmax(0, 58fr) !important;
  grid-template-rows: auto !important;
  flex-direction: initial !important;
  gap: 12px !important;
  padding: 10px 12px !important;
}

body.purchase-tablet-fit .purchase-panel {
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  border-radius: 28px !important;
  overflow: hidden !important;
}

body.purchase-tablet-fit .purchase-summary,
body.purchase-tablet-fit .purchase-form-panel {
  padding: 18px 20px !important;
}

body.purchase-tablet-fit .purchase-summary {
  display: flex !important;
  flex-direction: column !important;
}

body.purchase-tablet-fit .purchase-summary .eyebrow,
body.purchase-tablet-fit .form-head .eyebrow {
  width: fit-content !important;
  margin: 0 0 9px !important;
  padding: 7px 14px !important;
  gap: 8px !important;
  font-size: 10px !important;
  letter-spacing: .14em !important;
  white-space: nowrap !important;
}

body.purchase-tablet-fit .eyebrow-icon {
  width: 24px !important;
  height: 24px !important;
  font-size: 13px !important;
}

body.purchase-tablet-fit .purchase-summary h1 {
  margin: 0 0 10px !important;
  max-width: 100% !important;
  font-size: 42px !important;
  line-height: .96 !important;
  letter-spacing: -.035em !important;
}

body.purchase-tablet-fit .purchase-summary .lead {
  display: block !important;
  margin: 0 0 12px !important;
  max-width: 100% !important;
  font-size: 13px !important;
  line-height: 1.34 !important;
}

body.purchase-tablet-fit .price-row {
  min-height: 0 !important;
  margin: 0 0 10px !important;
  padding: 12px 16px !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 16px !important;
  border-radius: 20px !important;
}

body.purchase-tablet-fit .price {
  flex: 0 0 auto !important;
  padding: 0 !important;
  font-size: 64px !important;
  line-height: .9 !important;
}

body.purchase-tablet-fit .price-note {
  min-width: 0 !important;
  font-size: 13px !important;
  line-height: 1.25 !important;
}

body.purchase-tablet-fit .gcash-card {
  width: 100% !important;
  margin: 0 0 9px !important;
  padding: 12px 14px 9px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 12px !important;
  border-radius: 20px !important;
}

body.purchase-tablet-fit .gcash-copy strong {
  margin-bottom: 8px !important;
  font-size: 13px !important;
}

body.purchase-tablet-fit .gcash-copy strong::before {
  width: 28px !important;
  height: 28px !important;
  font-size: 14px !important;
}

body.purchase-tablet-fit .gcash-details {
  gap: 4px !important;
  margin-bottom: 8px !important;
  font-size: 12px !important;
  line-height: 1.28 !important;
}

body.purchase-tablet-fit .gcash-details span:first-child {
  font-size: 12px !important;
}

body.purchase-tablet-fit .gcash-card .btn,
body.purchase-tablet-fit .gcash-copy .btn {
  width: auto !important;
  min-height: 36px !important;
  margin: 0 !important;
  padding: 0 16px !important;
  font-size: 11px !important;
}

body.purchase-tablet-fit .gcash-qr {
  width: auto !important;
  justify-self: center !important;
}

body.purchase-tablet-fit .gcash-qr img {
  width: 122px !important;
  height: auto !important;
  border-width: 4px !important;
  border-radius: 12px !important;
}

body.purchase-tablet-fit .gcash-qr figcaption {
  display: block !important;
  margin-top: 2px !important;
  font-size: 9px !important;
}

body.purchase-tablet-fit .benefit-grid {
  margin: 7px 0 0 !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
}

body.purchase-tablet-fit .benefit {
  min-height: 32px !important;
  padding: 5px 8px !important;
  justify-content: flex-start !important;
  text-align: left !important;
  border-radius: 14px !important;
  font-size: 10px !important;
  gap: 6px !important;
}

body.purchase-tablet-fit .benefit::before {
  display: grid !important;
  width: 19px !important;
  height: 19px !important;
  font-size: 10px !important;
}

body.purchase-tablet-fit .device-note {
  display: flex !important;
  width: 100% !important;
  margin: 7px 0 0 !important;
  padding: 7px 10px !important;
  align-items: center !important;
  gap: 8px !important;
  border-radius: 14px !important;
  font-size: 9.5px !important;
  line-height: 1.28 !important;
}

body.purchase-tablet-fit .device-note::before {
  font-size: 20px !important;
}

body.purchase-tablet-fit .form-head {
  margin-bottom: 10px !important;
}

body.purchase-tablet-fit .form-head .eyebrow {
  display: inline-flex !important;
}

body.purchase-tablet-fit .form-head h2 {
  margin: 0 !important;
  font-size: 34px !important;
  line-height: .98 !important;
  letter-spacing: -.035em !important;
  white-space: normal !important;
}

body.purchase-tablet-fit .purchase-form-panel form {
  display: block !important;
  height: auto !important;
  overflow: visible !important;
}

body.purchase-tablet-fit .purchase-fields,
body.purchase-tablet-fit .purchase-fields.upgrade-mode {
  display: grid !important;
  grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  gap: 8px 10px !important;
}

body.purchase-tablet-fit .purchase-fields .field-block {
  width: auto !important;
}

body.purchase-tablet-fit #fieldKeyStage {
  grid-column: span 4 !important;
}

body.purchase-tablet-fit #fieldEmail {
  grid-column: span 8 !important;
}

body.purchase-tablet-fit #fieldUsername,
body.purchase-tablet-fit #fieldOrderType,
body.purchase-tablet-fit #upgradeWrap,
body.purchase-tablet-fit #amount {
  grid-column: 1 / -1 !important;
}

body.purchase-tablet-fit .purchase-fields.upgrade-mode #fieldOrderType {
  grid-column: span 5 !important;
}

body.purchase-tablet-fit .purchase-fields.upgrade-mode #upgradeWrap {
  grid-column: span 7 !important;
}

body.purchase-tablet-fit .purchase-fields.upgrade-mode #amount {
  grid-column: 1 / -1 !important;
}

body.purchase-tablet-fit .purchase-fields label {
  margin-bottom: 4px !important;
  font-size: 11px !important;
}

body.purchase-tablet-fit .purchase-fields select,
body.purchase-tablet-fit .field-shell {
  width: 100% !important;
  height: 42px !important;
  min-height: 42px !important;
  border-radius: 14px !important;
}

body.purchase-tablet-fit .purchase-fields select {
  padding: 0 13px !important;
  font-size: 12px !important;
}

body.purchase-tablet-fit .field-shell {
  padding: 0 12px !important;
  gap: 8px !important;
}

body.purchase-tablet-fit .field-shell input {
  font-size: 12px !important;
}

body.purchase-tablet-fit .amount-bar {
  min-height: 40px !important;
  padding: 8px 12px !important;
  border-radius: 14px !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
}

body.purchase-tablet-fit .receipt-box {
  width: 100% !important;
  padding: 8px 10px !important;
  border-radius: 15px !important;
}

body.purchase-tablet-fit .receipt-box > label {
  margin-bottom: 6px !important;
  font-size: 11px !important;
}

body.purchase-tablet-fit .upload-shell {
  width: 100% !important;
  min-height: 0 !important;
  padding: 10px 12px !important;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  grid-template-rows: auto !important;
  gap: 10px !important;
  align-items: center !important;
  border-radius: 15px !important;
}

body.purchase-tablet-fit .upload-icon {
  width: 36px !important;
  height: 36px !important;
  grid-row: auto !important;
}

body.purchase-tablet-fit .upload-icon svg {
  width: 30px !important;
  height: 30px !important;
}

body.purchase-tablet-fit .upload-copy {
  min-height: 0 !important;
}

body.purchase-tablet-fit .upload-copy strong {
  font-size: 11px !important;
}

body.purchase-tablet-fit .upload-copy span {
  margin-top: 2px !important;
  font-size: 9px !important;
}

body.purchase-tablet-fit .upload-button {
  grid-column: auto !important;
  grid-row: auto !important;
  width: auto !important;
  min-width: 128px !important;
  height: 42px !important;
  min-height: 42px !important;
  margin: 0 !important;
  padding: 0 18px !important;
  justify-self: end !important;
  border-radius: 13px !important;
  font-size: 10px !important;
}

body.purchase-tablet-fit .receipt-preview {
  max-height: 54px !important;
  margin-top: 5px !important;
}

body.purchase-tablet-fit .status-note {
  min-height: 36px !important;
  padding: 7px 10px !important;
  border-radius: 14px !important;
  font-size: 9.5px !important;
  line-height: 1.25 !important;
}

body.purchase-tablet-fit .purchase-actions {
  width: auto !important;
  min-height: 36px !important;
  margin-top: 7px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

body.purchase-tablet-fit .purchase-actions .btn {
  width: auto !important;
  min-height: 36px !important;
  padding: 0 16px !important;
  justify-content: center !important;
  font-size: 11px !important;
}

body.purchase-tablet-fit .purchase-status {
  display: inline !important;
  margin-top: 0 !important;
  font-size: 10px !important;
}


/* v1.5.4 full-width rule: the fitted Payment workspace uses the complete
   available horizontal viewport. Internal approved panel padding/layout is
   untouched; only the outer unused left/right gutters are removed. */
body.purchase-page-fit .main {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body.purchase-page-fit .frame {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* v1.5.6 filename-only receipt selection */
.receipt-box img,.receipt-box picture,.receipt-box canvas,.receipt-box video,.receipt-box .receipt-preview,.receipt-box #receiptPreview,.receipt-box [data-receipt-preview],.receipt-box [data-file-preview]{display:none!important;width:0!important;height:0!important;max-width:0!important;max-height:0!important;margin:0!important;padding:0!important;border:0!important;opacity:0!important;visibility:hidden!important;position:absolute!important;pointer-events:none!important}
.receipt-box{overflow:hidden!important}

/* AcadMates Payment v1.6.0 — clean canvas + 3D macaron header pills
   IMPORTANT: visual-only override. Do not alter the approved purchase layout. */

/* Remove ONLY the single large outer card/frame that wraps both columns. */
body .frame {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
body .frame::before {
  display: none !important;
  content: none !important;
}

/* Keep the two approved header pills in place, but give them a subtle
   dimensional macaron finish without changing their sizing or layout. */
body .purchase-summary .eyebrow,
body .form-head .eyebrow {
  position: relative !important;
  isolation: isolate !important;
  border: 1px solid rgba(255,255,255,.82) !important;
  box-shadow:
    0 8px 16px rgba(28,40,72,.10),
    0 2px 4px rgba(28,40,72,.08),
    inset 0 2px 0 rgba(255,255,255,.92),
    inset 0 -3px 7px rgba(45,55,88,.06) !important;
  overflow: hidden !important;
}

body .purchase-summary .eyebrow {
  background: linear-gradient(180deg,
    rgba(255,252,239,.98) 0%,
    rgba(249,239,208,.96) 46%,
    rgba(244,226,178,.96) 100%) !important;
  border-color: rgba(208,171,74,.30) !important;
}

body .form-head .eyebrow {
  background: linear-gradient(180deg,
    rgba(248,252,255,.99) 0%,
    rgba(229,239,255,.98) 46%,
    rgba(210,226,251,.96) 100%) !important;
  border-color: rgba(80,130,215,.25) !important;
}

body .purchase-summary .eyebrow::after,
body .form-head .eyebrow::after {
  content: "" !important;
  position: absolute !important;
  z-index: -1 !important;
  left: 8px !important;
  right: 8px !important;
  top: 3px !important;
  height: 42% !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,0)) !important;
  pointer-events: none !important;
}

body .purchase-summary .eyebrow-icon,
body .form-head .eyebrow-icon {
  box-shadow:
    0 5px 10px rgba(26,38,68,.14),
    inset 0 2px 1px rgba(255,255,255,.48),
    inset 0 -2px 4px rgba(0,0,0,.08) !important;
}

/* AcadMates Payment v1.6.2 — flat 2D header pills
   Visual-only override. Preserve the approved Payment layout and all other cards. */
body .purchase-summary .eyebrow,
body .form-head .eyebrow {
  position: relative !important;
  isolation: auto !important;
  overflow: visible !important;
  box-shadow: none !important;
  border-width: 1px !important;
  border-style: solid !important;
}

body .purchase-summary .eyebrow {
  background: rgba(143,214,211,.14) !important;
  border-color: rgba(208,171,74,.20) !important;
  color: #2F817B !important;
}

body .form-head .eyebrow {
  background: rgba(78,139,225,.11) !important;
  border-color: rgba(80,130,215,.18) !important;
  color: #2f5cb0 !important;
}

body .purchase-summary .eyebrow::after,
body .form-head .eyebrow::after {
  display: none !important;
  content: none !important;
}

body .purchase-summary .eyebrow-icon,
body .form-head .eyebrow-icon {
  box-shadow: none !important;
}

body .purchase-summary .eyebrow-icon {
  background: #516A91 !important;
  color: #fff !important;
}

body .form-head .eyebrow-icon {
  background: #4f7fd5 !important;
  color: #fff !important;
}

/* AcadMates Payment v1.6.4 — readable natural-size scrolling
   Preserve the approved Payment layout. Do not scale the whole UI to fit
   viewport height; let longer multi-license content extend downward and use
   normal vertical page scrolling instead. */
html,
body {
  height: auto !important;
  min-height: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

body.purchase-natural-scroll,
body.purchase-natural-scroll .site-shell {
  height: auto !important;
  min-height: 100dvh !important;
  max-height: none !important;
  overflow: visible !important;
}

body.purchase-natural-scroll .main {
  display: block !important;
  min-height: 0 !important;
  height: auto !important;
  overflow: visible !important;
  /* Use almost all screen width while retaining a small comfortable gutter. */
  padding-left: clamp(10px, 1.25vw, 20px) !important;
  padding-right: clamp(10px, 1.25vw, 20px) !important;
  padding-top: clamp(12px, 1.5vw, 22px) !important;
  padding-bottom: clamp(24px, 3vw, 48px) !important;
}

body.purchase-natural-scroll .frame {
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  overflow: visible !important;
}

body.purchase-natural-scroll .purchase-layout {
  position: relative !important;
  inset: auto !important;
  left: auto !important;
  top: auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  transform: none !important;
  transform-origin: initial !important;
  will-change: auto !important;
  overflow: visible !important;
  align-items: stretch !important;
}

body.purchase-natural-scroll .purchase-panel,
body.purchase-natural-scroll .purchase-summary,
body.purchase-natural-scroll .purchase-form-panel,
body.purchase-natural-scroll .purchase-form-panel form,
body.purchase-natural-scroll .purchase-fields,
body.purchase-natural-scroll .purchase-actions {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

/* Keep typography readable at desktop/tablet widths. These declarations only
   establish minimum comfortable sizes; positions and approved card layout stay
   unchanged. */
@media (min-width: 901px) {
  body.purchase-natural-scroll .purchase-summary .eyebrow,
  body.purchase-natural-scroll .form-head .eyebrow {
    font-size: 11px !important;
  }

  body.purchase-natural-scroll .purchase-summary .lead {
    font-size: clamp(14px, 1vw, 16px) !important;
    line-height: 1.42 !important;
  }

  body.purchase-natural-scroll .gcash-copy strong,
  body.purchase-natural-scroll .gcash-details {
    font-size: 12.5px !important;
  }

  body.purchase-natural-scroll .benefit {
    font-size: 11px !important;
  }

  body.purchase-natural-scroll .device-note {
    font-size: 11px !important;
    line-height: 1.38 !important;
  }

  body.purchase-natural-scroll .purchase-fields label {
    font-size: 12px !important;
  }

  body.purchase-natural-scroll .purchase-fields select,
  body.purchase-natural-scroll .field-shell input {
    font-size: 13.5px !important;
  }

  body.purchase-natural-scroll .package-note,
  body.purchase-natural-scroll .allocation-grid label span,
  body.purchase-natural-scroll .allocation-status {
    font-size: 11px !important;
  }

  body.purchase-natural-scroll .amount-bar {
    font-size: 13px !important;
  }

  body.purchase-natural-scroll .receipt-box > label,
  body.purchase-natural-scroll .upload-copy strong {
    font-size: 12px !important;
  }

  body.purchase-natural-scroll .upload-copy span,
  body.purchase-natural-scroll .status-note,
  body.purchase-natural-scroll .purchase-status {
    font-size: 10.5px !important;
  }

  body.purchase-natural-scroll .upload-button,
  body.purchase-natural-scroll .purchase-actions .btn {
    font-size: 12px !important;
  }
}

/* Tablets may need additional vertical room; scrolling is intentional and no
   content is compressed or clipped. Keep the existing responsive arrangement. */
@media (max-width: 1100px) {
  body.purchase-natural-scroll .main,
  body.purchase-natural-scroll .frame,
  body.purchase-natural-scroll .purchase-layout,
  body.purchase-natural-scroll .purchase-panel,
  body.purchase-natural-scroll .purchase-form-panel,
  body.purchase-natural-scroll .purchase-form-panel form {
    overflow: visible !important;
  }
}
