:root {
  color-scheme: light;
  --bg: #ffffff;
  --soft: #f7f7f8;
  --panel: #ffffff;
  --text: #0d0d0d;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --primary: #10a37f;
  --primary-strong: #0e8f70;
  --danger: #c43b45;
  --success: #0e7c59;
  --shadow: 0 18px 55px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 56px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: 54px;
  border-bottom: 1px solid var(--line);
}

.brand,
.top-actions,
.section-head,
.auth-tabs,
.field-row {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
}

.top-actions {
  gap: 10px;
  flex-wrap: wrap;
}

.ghost-button,
.secondary-link,
.primary-link,
.primary-button,
.download-button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  cursor: pointer;
  font-weight: 700;
}

.ghost-button,
.secondary-link {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

.primary-link,
.primary-button,
.download-button {
  background: var(--primary);
  color: #fff;
}

.primary-button:hover,
.download-button:hover,
.primary-link:hover {
  background: var(--primary-strong);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.pricing-hero {
  text-align: center;
  max-width: 820px;
  margin: 74px auto 34px;
}

.page-view.hidden {
  display: none;
}

.pricing-hero h1 {
  margin: 0;
  font-size: clamp(40px, 6.5vw, 76px);
  line-height: 1.02;
  letter-spacing: 0;
}

.pricing-hero p:not(.eyebrow) {
  max-width: 680px;
  margin: 20px auto 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.eyebrow,
.card-kicker {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.notice {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 120;
  width: min(420px, calc(100vw - 36px));
  margin: 0;
  border-radius: 8px;
  padding: 14px 16px 14px 18px;
  background: #fff8e6;
  border: 1px solid #f2d28b;
  color: #714600;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
  font-weight: 800;
  line-height: 1.55;
  animation: toastIn 180ms ease-out both;
}

.notice.success {
  background: #eaf8f2;
  border-color: #9dd9c0;
  color: #0b5f40;
}

.notice.error {
  background: #fff0f1;
  border-color: #f0a6ad;
  color: #962b34;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.account-strip {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin: 0 auto 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--soft);
}

.account-strip h2 {
  margin: 0;
  font-size: 22px;
}

.account-strip p {
  margin-bottom: 0;
  color: var(--muted);
}

.user-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
  min-width: 230px;
}

.user-summary strong,
.user-summary span {
  display: block;
}

.user-summary span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.pricing-section,
.payment-panel,
.download-card,
.help-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.pricing-section {
  padding: 24px;
}

.reveal-packages {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 520ms ease, transform 520ms cubic-bezier(.2, .8, .2, 1);
}

.reveal-packages.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.download-wide {
  margin-top: 18px;
}

.section-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: 0;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.billing-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.billing-tabs button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.billing-tabs button.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  transition: opacity 220ms ease, transform 220ms ease, filter 220ms ease;
}

.plans.plans-leaving {
  opacity: 0;
  transform: translateY(10px);
  filter: blur(2px);
}

.plans.plans-entering {
  animation: plans-fade-in 280ms ease both;
}

.empty-card {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: var(--soft);
}

.empty-card h3 {
  margin: 0 0 8px;
}

.empty-card p {
  margin: 0;
  color: var(--muted);
}

.plan-card {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 430px;
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 460ms ease, transform 460ms cubic-bezier(.2, .8, .2, 1), box-shadow 180ms ease, border-color 180ms ease;
  transition-delay: var(--reveal-delay, 0ms);
}

.plans.is-visible .plan-card,
.plans.plans-entering .plan-card {
  opacity: 1;
  transform: translateY(0);
}

.plan-card:nth-child(2),
.plan-card.selected {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--text);
}

.plan-card:nth-child(2)::before {
  content: "นิยม";
  position: absolute;
  top: -13px;
  left: 18px;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}

@keyframes plans-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal-packages,
  .plans,
  .plan-card,
  .billing-tabs button {
    animation: none !important;
    transition: none !important;
  }
}

.plan-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.plan-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.period-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: #f3f4f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.plan-head h3 {
  margin: 0;
  font-size: 25px;
}

.plan-desc {
  min-height: 52px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.price {
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
}

.old-price {
  color: var(--danger);
  text-decoration: line-through;
  font-size: 14px;
  font-weight: 700;
}

.features {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 14px 0 0;
  list-style: none;
  color: #1f2937;
  border-top: 1px solid var(--line);
}

.feature {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.feature span::before {
  content: "✓";
  color: var(--primary);
  font-weight: 900;
  margin-right: 8px;
}

.feature strong {
  color: var(--text);
}

.plan-card .primary-button {
  width: 100%;
  margin-top: auto;
}

.purchase-section,
.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.checkout-hero {
  max-width: 760px;
  margin: 54px 0 26px;
}

.checkout-hero h1 {
  margin: 0;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.05;
}

.checkout-hero p:not(.eyebrow) {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.back-link,
.inline-link {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 16px;
  color: var(--primary);
  font-weight: 800;
}

.inline-link {
  margin: 12px 0 0;
}

.payment-panel,
.download-card,
.help-card {
  padding: 22px;
}

.checkout-side {
  display: grid;
  gap: 18px;
}

.help-card {
  display: grid;
  gap: 10px;
}

.help-card span {
  color: var(--muted);
}

.summary-card,
.result-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.summary-card strong,
.summary-card span,
.result-box strong,
.result-box span {
  display: block;
}

.summary-card span,
.result-box span {
  color: var(--muted);
  margin-top: 6px;
}

.checkout-plan-card {
  display: grid;
  gap: 16px;
}

.checkout-plan-top,
.checkout-price-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.mini-eyebrow {
  color: var(--primary) !important;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  margin: 0 0 5px !important;
}

.checkout-plan-top strong {
  font-size: 28px;
  line-height: 1.1;
}

.checkout-plan-top p,
.checkout-plan-hint {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.checkout-price-row {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  align-items: center;
}

.checkout-price-row span {
  margin: 0;
}

.checkout-price-row b {
  font-size: 34px;
  line-height: 1;
}

.checkout-plan-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.checkout-plan-features span {
  min-height: 42px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.checkout-plan-features b {
  color: var(--text);
  white-space: nowrap;
}

.muted-card {
  color: var(--muted);
}

.bank-section h3 {
  margin: 20px 0 10px;
}

.qr-section h3 {
  margin: 20px 0 10px;
}

.start-payment-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 16px;
  display: grid;
  gap: 10px;
}

.start-payment-card strong,
.start-payment-card span {
  display: block;
}

.start-payment-card span {
  color: var(--muted);
  line-height: 1.5;
}

.start-payment-card .primary-button {
  width: fit-content;
  min-width: 190px;
}

.qr-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.qr-box img {
  width: 176px;
  height: 176px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.qr-box strong,
.qr-box span,
.qr-box small {
  display: block;
}

.qr-box span {
  color: var(--muted);
  margin-top: 6px;
}

.qr-box small {
  color: var(--primary);
  font-weight: 700;
  line-height: 1.5;
  margin-top: 10px;
}

.qr-cancel-button {
  width: fit-content;
  margin-top: 12px;
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.method-field {
  margin-top: 16px;
}

.banks {
  display: grid;
  gap: 10px;
}

.bank-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 12px;
}

.bank-card strong,
.bank-card span {
  display: block;
}

.bank-card span {
  color: var(--muted);
  line-height: 1.5;
}

.upload-box {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

label {
  display: grid;
  gap: 7px;
  width: 100%;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.14);
}

.payment-details {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 4px;
}

.file-picker {
  border: 1px dashed #9ca3af;
  border-radius: 8px;
  background: var(--soft);
  padding: 16px;
  cursor: pointer;
}

.file-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.file-picker span,
.file-picker b {
  display: block;
}

.file-picker b {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.download-card {
  display: grid;
  gap: 12px;
}

.download-card h2 {
  margin: 0;
  font-size: 26px;
}

.download-card p,
.download-card small {
  color: var(--muted);
  line-height: 1.6;
}

.download-button {
  width: 100%;
}

.result-box.success {
  border-color: #8bd1b7;
  background: #eaf8f2;
  color: #0b5f40;
}

.result-box.error {
  border-color: #f0a6ad;
  background: #fff0f1;
  color: #962b34;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: start center;
  background: rgba(12, 22, 38, 0.42);
  padding: 0 18px 32px;
  overflow-y: auto;
}

.contact-overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 22, 38, 0.42);
}

.verify-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 22, 38, 0.48);
}

.verify-panel {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 30px 24px 24px;
  text-align: center;
  animation: contactIn 180ms ease-out both;
}

.verify-panel h2 {
  margin: 0;
  font-size: 30px;
}

.verify-panel p:not(.eyebrow) {
  margin: 10px auto 22px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 340px;
}

.verify-icon {
  width: 66px;
  height: 66px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.verify-icon.loading {
  border: 5px solid #d7efe7;
  border-top-color: var(--primary);
  animation: spin 850ms linear infinite;
}

.verify-icon.success {
  background: #eaf8f2;
  border: 1px solid #9dd9c0;
}

.verify-icon.success::before {
  content: "✓";
  color: var(--success);
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
}

.verify-icon.error {
  background: #fff0f1;
  border: 1px solid #f0a6ad;
}

.verify-icon.error::before {
  content: "!";
  color: var(--danger);
  font-size: 38px;
  font-weight: 900;
}

.verify-panel .primary-button {
  min-width: 150px;
}

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

.contact-panel {
  position: relative;
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 24px;
  animation: contactIn 180ms ease-out both;
}

.contact-panel h2 {
  margin: 0;
  font-size: 30px;
}

.contact-panel p:not(.eyebrow) {
  color: var(--muted);
  margin: 8px 42px 18px 0;
  line-height: 1.55;
}

.contact-list {
  display: grid;
  gap: 10px;
}

.contact-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
}

.contact-item:hover {
  border-color: #b7c0cb;
  background: #fff;
}

.contact-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-weight: 900;
  font-size: 12px;
}

.contact-item strong,
.contact-item small {
  display: block;
}

.contact-item small,
.contact-empty {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.contact-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 18px;
  background: var(--soft);
}

@keyframes contactIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-drop-wrap {
  position: relative;
  width: min(560px, 100%);
  margin-top: 18px;
  padding-top: 86px;
  transform-origin: top center;
  animation: dropBounce 780ms cubic-bezier(0.2, 0.9, 0.22, 1.15) both;
}

.hanger {
  position: absolute;
  inset: 0 0 auto;
  height: 104px;
  pointer-events: none;
}

.hanger::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 2px;
  width: 70px;
  height: 28px;
  border: 7px solid #263145;
  border-bottom: 0;
  border-radius: 48px 48px 0 0;
  transform: translateX(-50%);
}

.hanger span {
  position: absolute;
  top: 28px;
  width: 3px;
  height: 78px;
  background: linear-gradient(#263145, #7a889d);
  border-radius: 999px;
}

.hanger span:first-child {
  left: calc(50% - 92px);
  transform: rotate(8deg);
}

.hanger span:last-child {
  right: calc(50% - 92px);
  transform: rotate(-8deg);
}

.auth-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.auth-modal {
  position: relative;
  padding: 24px;
  box-shadow: var(--shadow);
}

.auth-modal::before,
.auth-modal::after {
  content: "";
  position: absolute;
  top: -10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #263145;
}

.auth-modal::before {
  left: calc(50% - 96px);
}

.auth-modal::after {
  right: calc(50% - 96px);
}

.auth-modal-head {
  padding-right: 36px;
  margin-bottom: 16px;
}

.auth-modal-head h2 {
  margin: 0;
  font-size: 30px;
}

.auth-modal-head p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.close-button {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.auth-tabs {
  display: flex;
  width: 100%;
  padding: 4px;
  border-radius: 8px;
  background: var(--soft);
  margin-bottom: 16px;
}

.tab {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.tab.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 6px 16px rgba(27, 39, 61, 0.08);
}

.auth-form {
  display: grid;
  gap: 12px;
}

.field-row {
  gap: 12px;
  align-items: start;
}

.otp-button {
  flex: 0 0 132px;
  margin-top: 22px;
  white-space: nowrap;
}

@keyframes dropBounce {
  0% {
    opacity: 0;
    transform: translateY(-170px) rotate(-2deg) scale(0.96);
  }
  58% {
    opacity: 1;
    transform: translateY(10px) rotate(1.2deg) scale(1.01);
  }
  74% {
    transform: translateY(-8px) rotate(-0.8deg) scale(1);
  }
  88% {
    transform: translateY(4px) rotate(0.35deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotate(0);
  }
}

@media (max-width: 980px) {
  .plans,
  .purchase-section,
  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .plan-desc {
    min-height: auto;
  }
}

@media (max-width: 700px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
  }

  .topbar,
  .account-strip,
  .section-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions > * {
    flex: 1;
  }

  .pricing-hero {
    margin: 42px auto 24px;
    text-align: left;
  }

  .pricing-hero h1 {
    font-size: 42px;
  }

  .pricing-section,
  .payment-panel,
  .download-card,
  .account-strip {
    padding: 18px;
  }

  .field-row {
    flex-direction: column;
  }

  .auth-drop-wrap {
    padding-top: 74px;
  }

  .hanger span:first-child {
    left: calc(50% - 74px);
  }

  .hanger span:last-child {
    right: calc(50% - 74px);
  }

  .auth-modal::before {
    left: calc(50% - 78px);
  }

  .auth-modal::after {
    right: calc(50% - 78px);
  }
}
