* { box-sizing: border-box; }
:root {
  color-scheme: light;
  font-family: "Noto Sans Thai", system-ui, sans-serif;
  color: #142743;
  background: linear-gradient(165deg, #e5edf8, #f8fafc 75%);
  min-height: 100%;
}
body {
  margin: 0;
  padding-inline: max(clamp(12px, 4vw, 24px), env(safe-area-inset-left))
                 max(clamp(12px, 4vw, 24px), env(safe-area-inset-right));
  padding-block: max(clamp(16px, 6svh, 80px), env(safe-area-inset-top))
                 max(24px, env(safe-area-inset-bottom));
  overflow-wrap: anywhere;
}
.wrap { width: min(100%, 480px); margin-inline: auto; }
.brand { display: grid; justify-items: center; gap: 10px; margin-bottom: 24px; text-align: center; }
.brand-logo { display: block; width: min(100%, 300px); height: auto; }
.card {
  padding: clamp(16px, 6vw, 40px);
  border: 1px solid #d5dfed;
  border-top: 3px solid #234e89;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 32px #14274310;
}
h1 { margin: 16px 0 8px; font-size: clamp(24px, 6vw, 30px); line-height: 1.35; }
h1:first-child { margin-top: 0; }
p { margin: 0; color: #4b5c73; line-height: 1.75; }
.actions { display: grid; gap: 10px; margin-top: 25px; }
.button {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid #234e89;
  border-radius: 8px;
  background: #234e89;
  color: #fff;
  font: inherit;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: #193d71; }
.secondary { color: #263d5e; border-color: #ced9e8; background: #fff; }
.secondary:hover { background: linear-gradient(165deg, #e5edf8, #f8fafc 75%);
  min-height: 100%; }
.button:focus-visible { outline: 3px solid #2e6fbe; outline-offset: 3px; }
#registration { display: grid; gap: 8px; }
#registration label { margin-top: 8px; font-weight: 700; }
#registration input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 12px;
  border: 1px solid #8193ad;
  border-radius: 8px;
  font: inherit;
  color: inherit;
}
#registration input:focus-visible { outline: 2px solid #2e6fbe; outline-offset: 2px; }
.hint { font-size: .875rem; }
dialog.card {
  width: min(100% - 32px, 420px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  color: inherit;
}
dialog::backdrop { background: #14274399; }
dialog h2 { margin: 0; font-size: 1.375rem; }
.line { background: #087542; border-color: #087542; }
.line:hover { background: #065b34; }

.intro { margin: 8px 0 12px; }
.page-note {
  margin: 16px 8px 0;
  color: #4b5c73;
  font-size: .875rem;
  line-height: 1.65;
  text-align: center;
}

.connection {
  margin-top: 12px;
  color: #36536b;
  font-weight: 700;
}
@media (max-height: 480px) and (orientation: landscape) {
  .brand { margin-bottom: 16px; }
}

.policy {
  max-height: min(12rem, 42vh);
  margin-top: 16px;
  padding: 12px 16px 16px;
  overflow-y: auto;
  border: 1px solid #ced9e8;
  border-radius: 8px;
  background: #f7f9fc;
}
.policy h2 { margin: 16px 0 4px; font-size: 1rem; }
.policy h2:first-child { margin-top: 0; }
.policy:focus-visible { outline: 2px solid #2e6fbe; outline-offset: 2px; }
.button:disabled { border-color: #ced9e8; background: #e8edf4; color: #4b5c73; cursor: default; }

.brand-label { font-weight: 700; }
.brand-years { font-size: .875rem; font-variant-numeric: tabular-nums; }

.consent {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin: 12px 0;
  cursor: pointer;
}
.consent input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: #234e89;
}
.consent input:focus-visible { outline: 2px solid #2e6fbe; outline-offset: 3px; }
