@font-face {
  font-family: 'CardX';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/CardX-Regular.otf?v=1") format('opentype');
}
@font-face {
  font-family: 'CardX';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/CardX-SemiBold.otf?v=1") format('opentype');
}
@font-face {
  font-family: 'CardX';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/CardX-Bold.otf?v=1") format('opentype');
}
@font-face {
  font-family: 'CardX';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/CardX-Italic.otf?v=1") format('opentype');
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/sarabun-400-0.woff2?v=1") format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/sarabun-400-1.woff2?v=1") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/sarabun-400-2.woff2?v=1") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/sarabun-400-3.woff2?v=1") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/sarabun-600-0.woff2?v=1") format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/sarabun-600-1.woff2?v=1") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/sarabun-600-2.woff2?v=1") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/sarabun-600-3.woff2?v=1") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/sarabun-700-0.woff2?v=1") format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/sarabun-700-1.woff2?v=1") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/sarabun-700-2.woff2?v=1") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/sarabun-700-3.woff2?v=1") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  color-scheme: light;
  --ink: #1D428A;
  --muted: #637381;
  --muted-strong: #55636F; /* 5:1 on --line; disabled-control text */
  --accent: #1D428A;
  --accent-hover: #17376F;
  --focus: #5C88DA;
  --ground: #F7FAFE;
  --surface: #FFFFFF;
  --line: #E3EAF7;
  --line-strong: #C6D3EC;
  --mint: #EEF4FD;
  --error: #9B2929;
  --error-surface: #FFF0ED;
  --warning: #854600;
  --warning-surface: #FFF5E7;
  --success: #16A34A;
  --radius-card: 24px;
  font-family: "CardX", "Sarabun", "Noto Sans Thai", system-ui, sans-serif;
  color: var(--ink);
  background: var(--ground);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 1.7; }
button, input, select, a { -webkit-tap-highlight-color: transparent; }
button, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--accent); text-underline-offset: 4px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
::selection { background: var(--mint); color: var(--ink); }

p { margin: 0 0 12px; }
.skip-link { position: fixed; top: -100px; left: 16px; background: var(--surface); padding: 10px; z-index: 2; }
.skip-link:focus { top: 10px; }
.site-header { background: var(--surface); border-top: 4px solid var(--focus); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1120px; margin: auto; min-height: 88px; padding: 16px 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 24px; }
.brand img { display: block; width: 120px; height: auto; aspect-ratio: 1656 / 950; }
.brand > span { border-inline-start: 1px solid var(--line); padding-inline-start: 24px; font-size: 14px; color: var(--muted); }
.campaign-year { background: var(--mint); padding: 8px 16px; border-radius: 999px; font-size: 13px; white-space: nowrap; }
main { max-width: 960px; margin: 0 auto; padding: 36px 32px 24px; }
.page-heading { margin-bottom: 28px; }
h1 { font-family: "CardX", "Sarabun", "Noto Sans Thai", system-ui, sans-serif; font-size: 38px; line-height: 1.4; letter-spacing: -.02em; font-weight: 700; margin: 0 0 14px; text-wrap: balance; }
.en-subtitle { display: block; font-size: 20px; line-height: 1.5; font-weight: 400; margin-top: 10px; letter-spacing: 0; }
.page-heading p { color: var(--muted); max-width: 65ch; }
.demo-banner { padding: 10px 16px; margin-bottom: 24px; background: var(--warning-surface); color: var(--warning); font-size: 13px; border-radius: 8px; }
.employee-summary { display: grid; grid-template-columns: 1.15fr 1fr 1.25fr 1fr; gap: 12px 20px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin: 0 0 20px; }
.employee-summary > div, .submit-area > div { min-width: 0; }
.employee-summary dd { margin: 0; font-size: 14px; line-height: 1.6; font-weight: 600; overflow-wrap: anywhere; }
.employee-summary dd, .employee-summary dt, .plan-detail dt, .plan-detail dd, .state-panel p { overflow-wrap: anywhere; }
.field-label { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-bottom: 4px; }
form, .state-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); }
form { padding: 28px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 600; font-size: 22px; padding: 0; margin-bottom: 6px; }
.field-hint { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.plan-detail { margin-top: 24px; padding: 24px; background: var(--ground); border: 1px solid var(--line); border-radius: 18px; }
.plan-detail h3 { font-size: 22px; line-height: 1.5; margin: 0 0 8px; font-weight: 600; }
.plan-detail dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, auto); margin: 16px 0; }
.plan-detail dt, .plan-detail dd { margin: 0; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.plan-detail dt { padding-inline-end: 20px; }
.plan-detail dd { font-weight: 600; text-align: end; padding-inline-start: 12px; font-variant-numeric: tabular-nums; }
.plan-detail summary { cursor: pointer; color: var(--accent); padding: 12px 0; min-height: 44px; }
.plan-detail li { font-size: 14px; margin-bottom: 12px; }
.plan-detail ul { padding-inline-start: 22px; }
.plan-detail > p:last-child { margin: 16px 0 0; }
.benefits-note { font-size: 13px; color: var(--muted); margin: 18px 0 24px; }
.confirmation-note { border-top: 1px solid var(--line); padding-top: 20px; font-size: 14px; }
.confirmation-note strong { font-weight: 600; }
.confirmation-note p { color: var(--muted); margin: 4px 0 0; }
.consent-fieldset { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.consent-fieldset legend { float: left; width: 100%; font-size: 17px; line-height: 1.7; margin-bottom: 10px; }
.consent-fieldset > .field-hint { clear: both; }
.consent-english { display: block; font-size: 15px; font-weight: 400; }
.consent-options { display: flex; flex-wrap: wrap; gap: 12px; }
.consent-options label { display: flex; align-items: center; gap: 10px; padding: 12px 18px; min-height: 48px; border: 1px solid var(--line-strong); border-radius: 14px; cursor: pointer; }
.consent-options label:hover { background: var(--ground); }
.consent-options label:has(input:checked) { background: var(--mint); border-color: var(--accent); }
.consent-options input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }
.consent-options label:has(input:disabled) { color: var(--muted); cursor: not-allowed; }
.submit-area { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; padding-top: 24px; margin-top: 24px; border-top: 1px solid var(--line); }
#selected-summary { display: block; font-weight: 600; }
#deadline { font-size: 12px; color: var(--muted); display: block; margin-top: 4px; }
.primary-button, .secondary-button { border-radius: 999px; min-height: 48px; }
.primary-button { border: 0; color: var(--surface); background: var(--accent); padding: 14px 24px; min-height: 52px; font-size: 15px; font-weight: 600; white-space: normal; }
.primary-button:hover:enabled, .primary-button:active:enabled { background: var(--accent-hover); }
.primary-button:disabled { background: var(--line); color: var(--muted-strong); }
.secondary-button { padding: 10px 20px; background: var(--surface); color: var(--accent); border: 1px solid var(--accent); margin-top: 12px; }
.secondary-button:hover { background: var(--mint); }
.form-error { padding: 12px 16px; border-radius: 8px; background: var(--error-surface); color: var(--error); font-size: 14px; margin-top: 20px; }
.state-panel { padding: 44px 28px; text-align: center; }
.state-panel h2 { font-size: 24px; line-height: 1.6; margin: 10px 0; }
.state-panel p { color: var(--muted); max-width: 60ch; margin: 0 auto 10px; }
.success-icon { width: 56px; height: 56px; color: var(--success); margin-bottom: 12px; }
.receipt-plan { font-size: 36px; font-weight: 600; margin: 22px 0; color: var(--accent); background: var(--mint); display: inline-block; padding: 8px 32px; border-radius: 14px; }
.state-panel .receipt-note { border-top: 1px solid var(--line); padding-top: 24px; margin-top: 26px; font-size: 14px; }
#receipt-heading:focus { outline: none; }
.page-footer { text-align: center; font-size: 12px; color: var(--muted); padding: 24px 10px; }
.page-footer p { margin: 4px 0; }
.loader { display: inline-block; width: 24px; height: 24px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 800px) {
  .employee-summary { grid-template-columns: 1fr 1fr; }
  }
@media (max-width: 640px) {
  .header-inner { padding: 14px 20px; min-height: 76px; gap: 12px; }
  .brand > span { display: none; }
  .campaign-year { font-size: 11px; padding: 6px 10px; }
  main { padding: 24px 16px 16px; }
  h1 { font-size: 28px; }
  .en-subtitle { font-size: 17px; }
  .page-heading { margin-bottom: 24px; }
  .page-heading p { font-size: 14px; }
  .employee-summary { padding: 12px; gap: 12px 16px; }
  form { padding: 24px 20px; }
  legend { font-size: 20px; }
  .submit-area { flex-direction: column; align-items: stretch; gap: 16px; }
  .primary-button { width: 100%; }
  .state-panel { padding: 32px 20px; }
  .state-panel h2 { font-size: 21px; }
}
@media (max-width: 560px) {
  .employee-summary { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .consent-options { flex-direction: column; }
  .plan-detail { padding: 18px 16px; }
  .plan-detail dl { grid-template-columns: minmax(0, 1fr); }
  .plan-detail dt, .plan-detail dd { font-size: 16px; }
  .plan-detail dt { border-bottom: 0; padding: 12px 0 0; }
  .plan-detail dd { text-align: start; padding: 6px 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .loader { animation: none; }
}

#employee-name > span[lang=en]{display:block;font-size:12px;font-weight:400;color:var(--muted);margin-top:2px}.benefit-group{display:block;width:fit-content;margin-top:4px;padding:2px 8px;border-radius:8px;background:var(--mint);color:var(--ink);font-size:12px;font-weight:400}


/* Confirmation dialog */
.confirm-dialog {
  width: min(calc(100vw - 32px), 760px);
  max-height: 90vh; max-height: 90dvh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 24px 60px rgba(29, 66, 138, 0.22);
  overflow: hidden;
}
.confirm-dialog::backdrop { background: rgba(16, 32, 66, 0.55); }
.confirm-dialog-body { display: flex; flex-direction: column; padding: 0; max-height: calc(90vh - 2px); max-height: calc(90dvh - 2px); }
.confirm-dialog-heading { flex: none; padding: 24px 24px 16px; border-bottom: 1px solid var(--line); }
.confirm-dialog h2 { margin: 0 0 12px; font-size: 1.25rem; line-height: 1.6; }
.confirm-label { margin: 0; color: var(--muted); font-size: 0.8125rem; line-height: 1.6; }
.confirm-plan {
  margin: 6px 0 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--mint);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.6;
}
.confirm-review { overflow-y: auto; min-height: 0; padding: 0 24px 20px; scrollbar-color: var(--line-strong) var(--ground); }
.confirm-review:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.confirm-review .plan-detail { margin: 0 0 20px; padding: 20px 0 0; border: 0; border-radius: 0; background: var(--surface); }
.confirm-review .plan-detail h3 { margin: 0 0 8px; font-size: 18px; }
.confirm-warning { margin: 0; text-wrap: pretty; color: var(--muted); font-size: 0.875rem; line-height: 1.7; }
.confirm-actions { flex: none; display: flex; align-items: stretch; gap: 12px; margin-top: 0; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--surface); }
.confirm-actions .primary-button,
.confirm-actions .secondary-button {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: auto;
  min-width: 0;
  height: 44px;
  min-height: 0;
  margin: 0;
  padding: 0 16px;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  transform: none;
}
@media (max-width: 480px) {
  .confirm-dialog-heading { padding: 16px; }
  .confirm-dialog h2 { font-size: 18px; }
  .confirm-review { padding: 0 16px 16px; }
  .confirm-actions { flex-direction: column-reverse; padding: 12px 16px; gap: 8px; }
  .confirm-actions .primary-button,
  .confirm-actions .secondary-button { flex: none; width: 100%; }
}
/* Short viewports: let the whole dialog scroll so the review area and both actions stay reachable. */
@media (max-height: 480px) {
  .confirm-dialog { overflow-y: auto; }
  .confirm-dialog-body { max-height: none; }
  .confirm-review { overflow: visible; min-height: auto; }
}

.plan-comparison { min-width: 0; margin: 18px 0 24px; }
#comparison-hint { margin-bottom: 8px; font-size: 12px; }
.comparison-scroll { overflow-x: auto; scroll-padding-inline: 12px; border: 1px solid var(--line); border-radius: 12px; scrollbar-color: var(--line-strong) var(--ground); }
.comparison-scroll:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
#comparison-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; line-height: 1.6; }
#comparison-table th, #comparison-table td { padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
#comparison-table thead th { min-width: 84px; background: var(--mint); text-align: center; font-weight: 600; }
#comparison-table tr > :first-child { position: sticky; left: 0; z-index: 1; min-width: 300px; width: 36%; padding: 10px 14px; background: var(--surface); text-align: left; font-weight: 400; }
#comparison-table thead tr > :first-child { background: var(--mint); font-weight: 600; }
#comparison-table tbody th span[lang=en] { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
#comparison-table td { text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
#comparison-table tbody tr:last-child > * { border-bottom: 0; }
.comparison-plan-name { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 6px 12px; border: 1px solid var(--accent); border-radius: 999px; background: var(--surface); white-space: nowrap; }
#comparison-table td.is-selected { background: var(--mint); }
#comparison-table th.is-selected .comparison-plan-name { color: var(--surface); background: var(--accent); }
.comparison-selected { display: block; margin-top: 4px; font-size: 11px; font-weight: 400; }
.comparison-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
@media (max-width: 640px) {
  #comparison-table tr > :first-child { min-width: 160px; width: 160px; }
  #comparison-table th, #comparison-table td { padding: 10px 6px; }
}
@media (max-width: 360px) {
  #comparison-table tr > :first-child { min-width: 128px; width: 128px; }
}

.comparison-choice { display: inline-flex; position: relative; cursor: pointer; }
.comparison-choice:hover .comparison-plan-name { background: var(--ground); }
.comparison-choice input:focus-visible + .comparison-plan-name { outline: 3px solid var(--focus); outline-offset: 3px; }
.comparison-choice input:disabled + .comparison-plan-name { opacity: .65; cursor: not-allowed; }

/* Hidden UI states take precedence over component display rules. */
:root [hidden] { display: none; }
