/* Customer portal Payment sheet (Elavon): the appointment details sheet, with the total and Pay pinned to its bottom */
.pay-sheet {
  gap: 16px;
  scroll-padding-bottom: 180px;
}

.pay-sheet-sub {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: #5e6066;
  overflow-wrap: anywhere;
}

.pay-sheet-sub:empty {
  display: none;
}

.pay-sheet-loading {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 14px;
  color: #5e6066;
}

.pay-spinner {
  width: 28px;
  height: 28px;
  flex: none;
  border: 3px solid #e3e3e0;
  border-top-color: var(--portal-primary);
  border-radius: 50%;
  animation: pay-spin 0.8s linear infinite;
}

@keyframes pay-spin {
  to {
    transform: rotate(360deg);
  }
}

.pay-sheet-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pay-sheet-loading[hidden],
.pay-sheet-body[hidden],
.pay-line[hidden],
.pay-line-group[hidden],
.pay-tips[hidden],
.pay-field-hint[hidden],
.pay-field-error[hidden],
.pay-sheet-footer[hidden] {
  display: none;
}

.pay-lines {
  margin: 0;
  display: flex;
  flex-direction: column;
  font-size: 15px;
  line-height: 1.4;
}

.pay-line-group {
  display: flex;
  flex-direction: column;
}

.pay-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid #eeeeeb;
}

.pay-line dt {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.pay-line dd {
  margin: 0;
  flex: none;
  font-weight: 500;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pay-line-muted dt {
  color: #5e6066;
}

.pay-line-meta {
  font-size: 13px;
  color: #5e6066;
  font-variant-numeric: tabular-nums;
}

.pay-credit {
  color: #1e7a46;
}

.pay-tips {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pay-tips-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

/* One row of equal buttons, however many tip options the business set */
.pay-tip-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
}

.pay-tip-grid:empty {
  display: none;
}

.pay-tip-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
}

.portal-body .pay-tip-btn {
  width: 100%;
  min-height: 64px;
  height: auto;
  margin: 0;
  padding: 6px 4px;
  border: 1px solid #b5b8b4;
  border-radius: 12px;
  background: #fff;
  color: #1d1f21;
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}

.portal-body .pay-tip-btn[aria-pressed="true"] {
  padding: 5px 3px;
  border: 2px solid var(--portal-primary);
  background: color-mix(in srgb, var(--portal-primary) 8%, #fff);
}

.portal-body .pay-tip-btn:focus-visible {
  outline: 2px solid #1d1f21;
  outline-offset: 2px;
}

.portal-body .pay-tip-btn:disabled {
  cursor: default;
}

.pay-tip-pct {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}

.pay-tip-amt {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  color: #5e6066;
  font-variant-numeric: tabular-nums;
}

.portal-body .pay-tip-custom {
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
}

.pay-money {
  position: relative;
}

.pay-money-sign {
  position: absolute;
  top: 0;
  left: 12px;
  height: 48px;
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  color: #5e6066;
  pointer-events: none;
}

.pay-money .profile-input {
  padding-left: 28px;
}

.pay-postal {
  text-transform: uppercase;
}

.pay-field-hint,
.pay-field-error {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #5e6066;
}

.pay-field-error {
  color: #a82a20;
}

.pay-sheet.is-busy .pay-sheet-body {
  opacity: 0.55;
}

.pay-sheet-footer {
  position: sticky;
  bottom: -24px;
  z-index: 1;
  margin: 4px -20px -24px;
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid #eeeeeb;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pay-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.pay-total span {
  font-size: 15px;
  font-weight: 600;
  color: #3f4246;
}

.pay-total strong {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.portal-body .pay-sheet-pay {
  width: 100%;
  height: 48px;
  margin: 0;
  font-size: 16px;
}

.pay-sheet-pay .pay-spinner {
  width: 18px;
  height: 18px;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
}

.pay-secure {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  color: #5e6066;
}

.pay-secure svg {
  margin-right: 6px;
  vertical-align: -2px;
}

@media (min-width: 768px) {
  .pay-sheet {
    gap: 18px;
  }

  .pay-sheet-footer {
    bottom: -28px;
    margin: 4px -28px -28px;
    padding: 16px 28px 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-body .pay-tip-btn {
    transition: none;
  }
}
