@font-face {
  font-family: "Legameon Inter";
  src: url("../_assets/legameon.com/129d26b56bdc78-inter_n4.b2a3f24c19b4de56e8871f609e73ca7f6d2e2bb9.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --green: #143f35;
  --green-2: #256554;
  --mint: #e3f0eb;
  --coral: #ed755b;
  --ink: #17231f;
  --muted: #66736e;
  --line: #dce3e0;
  --soft: #f5f7f6;
  --white: #fff;
  --red: #9a3f31;
  --red-soft: #f8e9e6;
  --amber: #805005;
  --amber-soft: #fff1d8;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--soft); color: var(--ink); font-family: "Legameon Inter", Arial, "Noto Sans Thai", sans-serif; }
body { min-height: 100vh; margin: 0; }
button, input, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.wordmark { color: var(--green); font-size: 22px; font-weight: 800; line-height: 1; text-decoration: none; }
.wordmark--light { color: var(--white); }

.page-loading { min-height: 100vh; display: grid; place-content: center; gap: 18px; text-align: center; }
.page-loading p { margin: 0; color: var(--muted); font-size: 13px; }

.auth-view { min-height: 100vh; display: grid; grid-template-columns: minmax(440px, 1.08fr) minmax(420px, .92fr); background: var(--white); }
.auth-visual { position: relative; min-height: 680px; overflow: hidden; background: var(--green); color: var(--white); }
.auth-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(10 28 23 / 18%), rgb(10 28 23 / 85%)); }
.auth-visual > img { width: 100%; height: 100%; object-fit: cover; }
.auth-visual__content { position: absolute; z-index: 1; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 42px clamp(36px, 5vw, 78px) 64px; }
.auth-visual__content > div { max-width: 650px; }
.auth-visual__content p, .auth-kicker, .section-title p, .modal-form header p, .member-intro p { margin: 0 0 8px; color: inherit; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.auth-visual__content h1 { max-width: 620px; margin: 0; font-size: clamp(38px, 4vw, 58px); line-height: 1.12; }
.auth-visual__content ul { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 42px 0 0; padding: 0; border-top: 1px solid rgb(255 255 255 / 35%); list-style: none; }
.auth-visual__content li { display: grid; gap: 6px; padding: 20px 18px 0 0; }
.auth-visual__content li strong { color: #ff9a83; font-size: 28px; }
.auth-visual__content li span { color: #dce9e4; font-size: 12px; }

.auth-panel { position: relative; display: grid; place-items: center; padding: 80px clamp(34px, 6vw, 92px); }
.auth-back { position: absolute; top: 34px; right: 38px; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; text-decoration: none; }
.auth-back svg { width: 18px; height: 18px; }
.auth-back:hover { color: var(--green); }
.auth-panel__inner { width: min(430px, 100%); }
.auth-kicker { color: var(--coral); }
.auth-panel h2 { margin: 0; font-size: 30px; line-height: 1.25; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 36px 0 26px; border-bottom: 1px solid var(--line); }
.auth-tabs button { min-height: 46px; padding: 0; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; cursor: pointer; }
.auth-tabs button.is-active { border-color: var(--green); color: var(--green); font-weight: 700; }
.auth-form, .modal-form { display: grid; gap: 17px; }
.auth-form label, .modal-form label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; }
.auth-form input, .modal-form input, .modal-form textarea { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid #bfcac6; border-radius: 4px; outline: 0; color: var(--ink); background: var(--white); }
.modal-form textarea { min-height: 104px; padding-block: 11px; resize: vertical; }
.auth-form input:focus, .modal-form input:focus, .modal-form textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgb(37 101 84 / 12%); }
.auth-form small { color: #89938f; font-size: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-message { margin: 0; padding: 10px 12px; border-radius: 4px; color: var(--red); background: var(--red-soft); font-size: 12px; }
.primary-button, .secondary-button, .danger-button, .text-button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 0 19px; border-radius: 3px; font-size: 13px; font-weight: 700; cursor: pointer; }
.primary-button { border: 1px solid var(--green); color: var(--white); background: var(--green); }
.primary-button:hover { background: #0e322a; }
.secondary-button { border: 1px solid var(--green); color: var(--green); background: var(--white); }
.secondary-button:hover { color: var(--white); background: var(--green); }
.danger-button { border: 1px solid var(--red); color: var(--white); background: var(--red); }
.text-button { border: 0; color: var(--muted); background: transparent; }
button:disabled { cursor: not-allowed; opacity: .5; }

.member-app { min-height: 100vh; background: var(--soft); }
.member-header { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 max(28px, calc((100% - 1240px) / 2)); border-bottom: 1px solid var(--line); background: var(--white); }
.member-header nav { display: flex; align-items: center; gap: 22px; }
.member-header nav > a, .member-header nav > button:not(.icon-button) { padding: 8px 0; border: 0; color: var(--muted); background: transparent; font-size: 12px; text-decoration: none; cursor: pointer; }
.member-header nav > a:hover, .member-header nav > button:hover { color: var(--green); }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: var(--white); cursor: pointer; }
.icon-button svg { width: 18px; height: 18px; }
.member-main { width: min(1240px, calc(100% - 56px)); margin-inline: auto; padding: 54px 0 76px; }
.member-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.member-intro p { color: var(--coral); }
.member-intro h1 { margin: 0; font-size: 36px; }
.member-identity { display: flex; align-items: center; gap: 12px; }
.member-identity strong { color: var(--muted); font-size: 12px; font-weight: 500; }
.member-status, .status-badge { display: inline-flex; min-height: 26px; align-items: center; padding: 3px 9px; border-radius: 3px; color: #175947; background: var(--mint); font-size: 11px; font-weight: 700; }
.member-status[data-status="registered"], .status-badge--created, .status-badge--pending { color: var(--amber); background: var(--amber-soft); }
.member-status[data-status="refund_pending"], .status-badge--refund_pending { color: var(--red); background: var(--red-soft); }
.member-status[data-status="refunded"], .status-badge--refunded, .status-badge--rejected, .status-badge--failed { color: #56605c; background: #e7ebe9; }
.status-badge--approved { color: #33546b; background: #e5f0f7; }

.balance-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 34px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); }
.balance-strip > div { min-height: 108px; display: grid; align-content: center; gap: 7px; padding: 20px 24px; border-right: 1px solid var(--line); }
.balance-strip > div:last-child { border-right: 0; }
.balance-strip span { color: var(--muted); font-size: 11px; }
.balance-strip strong { color: var(--green); font-size: 25px; }

.membership-panel { min-height: 236px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 36px; margin-top: 24px; padding: 42px 46px; border-radius: 6px; color: var(--white); background: var(--green); }
.membership-panel__copy { max-width: 720px; }
.membership-panel__eyebrow { margin: 0 0 8px; color: #a8c9be; font-size: 11px; font-weight: 700; }
.membership-panel h2 { margin: 0; font-size: 29px; }
.membership-panel p:not(.membership-panel__eyebrow) { max-width: 680px; margin: 14px 0 0; color: #cfddd8; font-size: 14px; line-height: 1.65; }
.membership-panel__actions { display: flex; align-items: center; gap: 10px; }
.membership-panel .primary-button { border-color: var(--coral); background: var(--coral); }
.membership-panel .secondary-button { border-color: rgb(255 255 255 / 60%); color: var(--white); background: transparent; }
.membership-panel__meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 22px; color: #a8c9be; font-size: 11px; }

.member-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }
.portal-section { min-width: 0; padding: 28px 30px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.section-title p { color: var(--coral); }
.section-title h2 { margin: 0; font-size: 19px; }
.section-title a { color: var(--green-2); font-size: 11px; font-weight: 700; text-decoration: none; }
.section-title .secondary-button { min-height: 38px; }
.record-list { margin: 0; padding: 0; list-style: none; }
.record-list li { min-height: 68px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 13px 0; border-bottom: 1px solid #e9edeb; }
.record-list li:last-child { border-bottom: 0; }
.record-list strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.record-list small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.record-list__value { text-align: right; white-space: nowrap; }
.record-list__value strong.is-positive { color: var(--green-2); }
.record-list__value strong.is-negative { color: var(--red); }
.empty-records { min-height: 142px; display: grid; place-content: center; margin: 0; color: var(--muted); font-size: 12px; text-align: center; }
.withdrawal-section { margin-top: 24px; }
.section-note { margin: 18px 0 4px; color: var(--muted); font-size: 11px; }
.withdrawal-table { width: 100%; margin-top: 16px; border-collapse: collapse; table-layout: fixed; }
.withdrawal-table th { height: 38px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; text-align: left; }
.withdrawal-table td { height: 58px; border-bottom: 1px solid #e9edeb; font-size: 12px; }
.withdrawal-table tr:last-child td { border-bottom: 0; }

.modal { width: min(510px, calc(100% - 28px)); max-width: none; max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 6px; color: var(--ink); background: var(--white); box-shadow: 0 28px 80px rgb(10 28 23 / 30%); }
.modal::backdrop { background: rgb(8 24 19 / 58%); }
.modal-form, .modal-body { padding: 30px; }
.modal-form header p { color: var(--coral); }
.modal-form header h2 { margin: 0; font-size: 23px; }
.modal-form > p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.modal-form footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.modal-form footer .primary-button, .modal-form footer .danger-button { width: auto; }
.modal-close { position: absolute; z-index: 2; top: 14px; right: 14px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 3px; color: var(--muted); background: var(--soft); cursor: pointer; }
.modal-close svg { width: 18px; height: 18px; }
.qr-content { text-align: center; }
.qr-content__eyebrow { margin: 0 0 6px; color: var(--coral); font-size: 11px; font-weight: 700; }
.qr-content h2 { margin: 0; font-size: 24px; }
.qr-content img { width: min(280px, 100%); aspect-ratio: 1; display: block; margin: 22px auto 14px; border: 1px solid var(--line); object-fit: contain; }
.qr-content__amount { margin: 0; color: var(--green); font-size: 30px; font-weight: 800; }
.qr-content__note { margin: 8px auto 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.qr-content__order { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }

.toast { position: fixed; z-index: 50; right: 22px; bottom: 22px; max-width: min(380px, calc(100% - 44px)); padding: 12px 16px; border-radius: 4px; color: var(--white); background: var(--green); box-shadow: 0 12px 34px rgb(10 28 23 / 26%); opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity 160ms ease, transform 160ms ease; }
.toast.is-visible { opacity: 1; transform: none; }
.toast.is-error { background: var(--red); }

:focus-visible { outline: 3px solid rgb(37 101 84 / 25%); outline-offset: 2px; }

@media (max-width: 920px) {
  .auth-view { grid-template-columns: 1fr; }
  .auth-visual { min-height: 340px; }
  .auth-visual__content { padding: 30px 36px 38px; }
  .auth-visual__content h1 { max-width: 620px; font-size: 38px; }
  .auth-visual__content ul { margin-top: 25px; }
  .auth-panel { min-height: 600px; padding-block: 96px 60px; }
  .member-main { width: min(100% - 40px, 1240px); }
  .balance-strip { grid-template-columns: 1fr 1fr; }
  .balance-strip > div:nth-child(2) { border-right: 0; }
  .balance-strip > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .membership-panel { grid-template-columns: 1fr; }
  .member-columns { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .auth-visual { min-height: 310px; }
  .auth-visual__content { padding: 25px 20px 30px; }
  .auth-visual__content h1 { font-size: 31px; }
  .auth-visual__content ul { grid-template-columns: 1fr; }
  .auth-visual__content li { min-height: 48px; grid-template-columns: 82px 1fr; align-items: center; padding: 0; border-bottom: 1px solid rgb(255 255 255 / 20%); }
  .auth-visual__content li strong { font-size: 21px; }
  .auth-panel { min-height: 570px; padding: 88px 20px 44px; }
  .auth-back { top: 28px; right: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .member-header { height: 64px; padding-inline: 16px; }
  .member-header nav { gap: 10px; }
  .member-header nav > a { display: none; }
  .member-header nav > button:not(.icon-button) { max-width: 120px; }
  .member-main { width: calc(100% - 28px); padding-block: 35px 52px; }
  .member-intro { display: grid; align-items: start; }
  .member-intro h1 { font-size: 29px; }
  .member-identity { align-items: flex-start; flex-direction: column; gap: 7px; }
  .balance-strip > div { min-height: 90px; padding: 15px; }
  .balance-strip strong { font-size: 20px; }
  .membership-panel { min-height: 0; padding: 28px 22px; }
  .membership-panel h2 { font-size: 24px; }
  .membership-panel__actions { align-items: stretch; flex-direction: column; }
  .portal-section { padding: 23px 19px; }
  .section-title { align-items: flex-start; }
  .withdrawal-table { min-width: 610px; }
  .withdrawal-section { overflow-x: auto; }
  .modal-form, .modal-body { padding: 27px 21px; }
  .toast { right: 14px; bottom: 14px; max-width: calc(100% - 28px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
