:root {
  --bg: #f3f0ef;
  --card: #fff;
  --line: #e8dddd;
  --text: #1f2937;
  --muted: #6b7280;
  --brand: #c62828;
  --brand-soft: #fff5f5;
  --ok: #2e7d32;
  --warn: #ed6c02;
  --radius: 16px;
  --shadow: 0 12px 40px rgba(90, 20, 16, 0.07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "IBM Plex Sans Thai", system-ui, sans-serif;
  background:
    radial-gradient(ellipse 90% 60% at 0% 0%, rgba(255, 235, 232, 0.9), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 0%, rgba(255, 248, 245, 0.95), transparent 50%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 28px 18px 56px;
}

.hero {
  margin-bottom: 20px;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.hero-brand img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(198, 40, 40, 0.15);
}

.eyebrow {
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 2px;
}

h1 {
  margin: 0;
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 700;
}

h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
}

.muted {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
}

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.card-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.card-section-title h3 {
  margin: 0;
}

.card-step {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="search"],
input:not([type]) {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  font: inherit;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus {
  outline: none;
  border-color: rgba(198, 40, 40, 0.45);
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.12);
}

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 11px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #d9342b, var(--brand));
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(198, 40, 40, 0.22);
  transition: transform 0.12s, box-shadow 0.15s;
}

button:hover,
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(198, 40, 40, 0.28);
}

button:active,
.btn:active {
  transform: translateY(0);
}

.btn.ghost,
button.ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn.ghost:hover {
  background: #fafafa;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.hidden { display: none !important; }

#lookupForm button {
  width: 100%;
  margin-top: 4px;
}

.status-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

#storeIdLabel {
  font-size: 13px;
  font-family: ui-monospace, monospace;
}

.badge {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #ffebee;
  color: var(--brand);
}

.badge.active,
.badge.trial {
  background: #e8f5e9;
  color: var(--ok);
}

.badge.expired,
.badge.suspended {
  background: #ffebee;
  color: var(--brand);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.grid div {
  background: linear-gradient(180deg, #fafafa, #fff);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

.grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.grid b {
  font-size: 15px;
  font-weight: 700;
}

.notice {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(90deg, #fff8e1, #fffbf0);
  border: 1px solid #ffe082;
  color: #8d6e00;
  font-size: 13px;
  line-height: 1.45;
}

.plan-hint {
  margin: 0 0 16px;
  font-size: 14px;
}

.pricing-sub {
  margin: 18px 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pricing-sub:first-of-type {
  margin-top: 4px;
}

.pricing {
  display: grid;
  gap: 12px;
}

.pricing-annual {
  grid-template-columns: repeat(2, 1fr);
}

.pricing-lifetime {
  grid-template-columns: repeat(2, 1fr);
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  min-height: 118px;
  padding: 16px 14px 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  box-shadow: none;
  transition: border-color 0.15s, background 0.15s, transform 0.12s, box-shadow 0.15s;
}

.plan-card:hover {
  border-color: rgba(198, 40, 40, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(90, 20, 16, 0.08);
}

.plan-card.is-selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px rgba(198, 40, 40, 0.2), 0 8px 24px rgba(198, 40, 40, 0.1);
}

.plan-card.highlight:not(.is-selected) {
  border-color: rgba(198, 40, 40, 0.35);
  background: linear-gradient(180deg, #fffafa, #fff);
}

.plan-card-name {
  display: block;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  padding-right: 52px;
}

.plan-card-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
}

.plan-card-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  margin-top: 2px;
}

.plan-card-price strong {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--brand);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.plan-card-price em {
  font-size: 13px;
  font-style: normal;
  font-weight: 600;
  color: var(--muted);
}

.plan-card-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: auto;
  padding-top: 4px;
}

.pay-note {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.selected-plan-box {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--brand-soft);
  border: 1px solid rgba(198, 40, 40, 0.15);
}

.selected-plan-box span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 4px;
}

.selected-plan-box b {
  font-size: 17px;
}

.selected-plan-box p {
  margin: 6px 0 0;
  font-size: 15px;
  color: var(--brand);
  font-weight: 700;
}

#payHint {
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.bank-box {
  margin-top: 14px;
  padding: 18px 16px 20px;
  border: 1px solid rgba(198, 40, 40, 0.12);
  border-radius: 16px;
  background: linear-gradient(165deg, #fffafa 0%, #fff 42%, #fffcfb 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.bank-box-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.bank-box-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  box-shadow: 0 4px 12px rgba(198, 40, 40, 0.1);
}

.bank-box h4 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
}

.bank-box-lead {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.bank-account-card {
  display: grid;
  gap: 0;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(90, 20, 16, 0.05);
}

.bank-account-row {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.bank-account-row:last-child {
  border-bottom: 0;
}

.bank-account-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.bank-account-row b {
  font-size: 15px;
  font-weight: 700;
}

.bank-name-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.bank-logo {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.1);
  background: #f3f4f6;
}

.bank-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.bank-logo-stack {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 40px;
}

.bank-logo-pp {
  position: absolute;
  left: -3px;
  bottom: -3px;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
  background: #fff;
}

.bank-promptpay-line {
  align-items: center;
  gap: 10px;
}

.bank-promptpay-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.bank-promptpay-text b {
  font-size: 14px;
}

.bank-account-promptpay-row .bank-logo--promptpay {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.bank-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  padding: 2px;
}

.bank-account-bank-row {
  background: linear-gradient(90deg, #fafafa 0%, #fff 55%);
}

.bank-account-number-row {
  background: linear-gradient(180deg, #fafafa, #fff);
}

.bank-account-copy-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.bank-account-number {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: clamp(1.05rem, 3.5vw, 1.25rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
  padding: 0;
  background: none;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(198, 40, 40, 0.22);
  background: #fff;
  color: var(--brand);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.btn-copy:hover {
  background: var(--brand-soft);
  transform: none;
  box-shadow: none;
}

.btn-copy:active {
  transform: scale(0.98);
}

.btn-copy.is-copied {
  border-color: rgba(46, 125, 50, 0.35);
  color: var(--ok);
  background: #e8f5e9;
}

.btn-copy-icon {
  flex-shrink: 0;
}

.bank-info-fallback {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  font-size: 14px;
  color: #8d6e00;
}

.slip-form-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.slip-form-divider::before,
.slip-form-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.slip-form {
  margin-top: 0;
}

.slip-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

.label-optional {
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
}

.label-required {
  font-style: normal;
  color: var(--brand);
  font-weight: 700;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.slip-upload {
  margin-bottom: 12px;
}

.slip-upload-label {
  display: block;
  margin-bottom: 8px;
}

.slip-upload-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 22px 16px;
  border: 2px dashed rgba(198, 40, 40, 0.22);
  border-radius: 14px;
  background: #fff;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.slip-upload:hover .slip-upload-box,
.slip-upload:focus-within .slip-upload-box {
  border-color: rgba(198, 40, 40, 0.45);
  background: var(--brand-soft);
}

.slip-upload-icon {
  color: var(--brand);
  margin-bottom: 4px;
  opacity: 0.85;
}

.slip-upload-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.slip-upload-hint {
  font-size: 12px;
  color: var(--muted);
}

.slip-upload.has-file .slip-upload-box {
  border-style: solid;
  border-color: rgba(46, 125, 50, 0.35);
  background: #f1f8f4;
}

.slip-submit {
  width: 100%;
  padding: 14px 18px;
  font-size: 15px;
  margin-top: 4px;
}

.slip-form label:last-of-type {
  margin-bottom: 8px;
}

.slip-preview {
  margin: 8px 0 12px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}

.slip-preview img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
}

.slip-status {
  margin: 10px 0 0;
  min-height: 1.2em;
  font-size: 13px;
}

.contact {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pay-actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.pay-actions .btn {
  width: 100%;
  padding: 14px 18px;
  font-size: 15px;
}

.btn.highlight.pay-prompt-focus {
  animation: payPulse 1.2s ease-in-out 3;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.25);
}

@keyframes payPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.footer-card {
  padding: 16px 20px;
  box-shadow: none;
  background: transparent;
  border: none;
}

body.pay-modal-open {
  overflow: hidden;
}

.pay-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(31, 41, 55, 0.48);
  backdrop-filter: blur(4px);
  animation: payModalFade 0.2s ease;
}

.pay-modal-backdrop.hidden {
  display: none !important;
}

@keyframes payModalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pay-modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: min(92vh, 820px);
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 40px rgba(90, 20, 16, 0.18);
  animation: payModalSlide 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes payModalSlide {
  from { transform: translateY(100%); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}

.pay-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: var(--tint, #fdecea);
  color: var(--brand-dark, #b02822);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  padding: 0;
  transition: transform 0.15s ease, background 0.15s ease;
}

.pay-modal-close:hover {
  background: var(--tint-strong, #fbdedb);
  transform: rotate(5deg) scale(1.06);
}

.pay-modal-head {
  flex-shrink: 0;
  padding: 22px 48px 12px 20px;
  border-bottom: 1px solid var(--line);
}

.pay-modal-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.pay-modal-sub {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.45;
}

.pay-modal-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 18px 24px;
  -webkit-overflow-scrolling: touch;
}

.pay-modal-body .bank-box {
  margin-top: 12px;
}

.pay-modal-body #payHint {
  margin-top: 0;
}

@media (min-width: 560px) {
  .pay-modal-backdrop {
    align-items: center;
    padding: 24px 16px;
  }

  .pay-modal {
    border-radius: 20px;
    max-height: min(88vh, 820px);
    animation-name: payModalPop;
  }

  @keyframes payModalPop {
    from { transform: scale(0.96) translateY(8px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
  }
}

@media (max-width: 520px) {
  .wrap { padding: 20px 14px 40px; }
  .pricing-annual,
  .pricing-lifetime,
  .grid {
    grid-template-columns: 1fr;
  }
  .slip-form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .plan-card-name { padding-right: 0; }
  .plan-card-tag { position: static; align-self: flex-start; margin-bottom: 4px; order: -1; }
}
