@font-face { font-family: 'TH Sarabun'; src: url('THSarabunPSK/THSarabun.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'TH Sarabun'; src: url('THSarabunPSK/THSarabun Bold.ttf') format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
    --g-950: #052e1a;
    --g-800: #065f35;
    --g-700: #078244;
    --g-600: #0a9d52;
    --g-500: #12b866;
    --g-100: #dcf7e8;
    --g-50:  #f1fbf5;
    --ink: #0f2a1d;
    --muted: #5b6f64;
    --line: #e1ece5;
    --blue: #1d4ed8;
    --ok: #0a9d52;
    --bad: #dc2626;
    --gold: #f5b942;
    --radius: 22px;
    --shadow: 0 30px 70px -20px rgba(3, 40, 22, .55), 0 8px 24px -8px rgba(3, 40, 22, .25);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'TH Sarabun', 'Sarabun', Tahoma, sans-serif;
    font-size: 22px;
    line-height: 1.35;
    color: var(--ink);
    background:
        radial-gradient(1100px 600px at 12% -10%, rgba(18, 184, 102, .55), transparent 60%),
        radial-gradient(900px 600px at 100% 110%, rgba(245, 185, 66, .28), transparent 60%),
        linear-gradient(160deg, var(--g-950) 0%, var(--g-800) 55%, #0b7a45 100%);
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 36px 16px 48px;
    overflow-x: hidden;
}

/* floating decorative blobs */
body::before, body::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .35;
    z-index: 0;
    pointer-events: none;
    animation: float 14s ease-in-out infinite;
}
body::before { width: 360px; height: 360px; background: var(--g-500); top: 8%; left: -90px; }
body::after  { width: 300px; height: 300px; background: var(--gold); bottom: 6%; right: -70px; animation-delay: -6s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(30px, -40px) scale(1.12); }
}
@keyframes rise {
    from { opacity: 0; transform: translateY(24px) scale(.985); }
    to   { opacity: 1; transform: none; }
}
@keyframes pop {
    0%   { transform: scale(.6); opacity: 0; }
    70%  { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); }
}

img { max-width: 100%; height: auto; }

.wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 760px;
    animation: rise .7s cubic-bezier(.2, .8, .2, 1) both;
}

/* ---------- card ---------- */
.card {
    background: rgba(255, 255, 255, .96);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-top {
    text-align: center;
    padding: 30px 26px 8px;
    background:
        radial-gradient(500px 180px at 50% 0%, var(--g-100), transparent 70%),
        #fff;
}
.card-top .logo {
    mix-blend-mode: multiply;
    display: block;
    margin: 0 auto 6px;
    max-height: 110px;
    width: auto;
}

.eyebrow {
    display: inline-block;
    padding: 4px 16px;
    border-radius: 999px;
    background: var(--g-100);
    color: var(--g-800);
    font-weight: 700;
    font-size: 23px;
    letter-spacing: .02em;
}

h1.title {
    margin: 12px 0 2px;
    font-size: 42px;
    line-height: 1.1;
    font-weight: 700;
    background: linear-gradient(90deg, var(--g-800), var(--g-500));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--g-800);
}
.subtitle {
    margin: 0 0 18px;
    font-size: 25px;
    color: var(--muted);
}

.card-body { padding: 10px 30px 34px; }

/* ---------- login form ---------- */
.field-label {
    display: block;
    margin: 6px 0 8px;
    font-size: 24px;
    font-weight: 700;
    color: var(--g-800);
}
.input-wrap { position: relative; }
.input-wrap svg {
    position: absolute;
    left: 18px;
    top: 50%;
    width: 26px;
    height: 26px;
    transform: translateY(-50%);
    color: var(--g-600);
    pointer-events: none;
}
.input-wrap input {
    width: 100%;
    height: 64px;
    padding: 0 18px 0 58px;
    border: 2px solid var(--line);
    border-radius: 16px;
    background: var(--g-50);
    font: 700 26px/1 'Consolas', 'Courier New', monospace;
    letter-spacing: .14em;
    color: var(--ink);
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.input-wrap input::placeholder { color: #a9bbb1; letter-spacing: .1em; font-weight: 400; }
.input-wrap input:focus {
    border-color: var(--g-500);
    background: #fff;
    box-shadow: 0 0 0 6px rgba(18, 184, 102, .18);
}
.input-wrap.invalid input { border-color: var(--bad); box-shadow: 0 0 0 6px rgba(220, 38, 38, .12); }

.hint { margin: 8px 4px 0; font-size: 22px; color: var(--muted); min-height: 24px; }
.hint.error { color: var(--bad); font-weight: 700; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 18px;
    height: 62px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--g-500), var(--g-700));
    color: #fff;
    font: 700 27px 'TH Sarabun', 'Sarabun', sans-serif;
    letter-spacing: .02em;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 14px 28px -10px rgba(7, 130, 68, .7);
    transition: transform .18s, box-shadow .18s, filter .18s;
}
.btn:hover  { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 18px 32px -10px rgba(7, 130, 68, .8); }
.btn:active { transform: translateY(0); }
.btn svg { width: 24px; height: 24px; }
.btn.ghost {
    background: #fff;
    color: var(--g-800);
    border: 2px solid var(--g-100);
    box-shadow: none;
}
.btn.ghost:hover { background: var(--g-50); border-color: var(--g-500); }

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 200px; }

.privacy {
    margin-top: 22px;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--g-50);
    border: 1px dashed #b6dcc6;
    font-size: 22px;
    color: var(--muted);
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.privacy svg { flex: 0 0 22px; width: 22px; height: 22px; color: var(--g-600); margin-top: 2px; }

/* ---------- result ---------- */
.profile {
    position: relative;
    padding: 28px 30px 26px;
    color: #fff;
    background:
        radial-gradient(420px 220px at 90% -20%, rgba(255, 255, 255, .22), transparent 70%),
        linear-gradient(135deg, var(--g-800), var(--g-600));
}
.profile .eyebrow { background: rgba(255, 255, 255, .18); color: #fff; }
.profile .name {
    margin: 12px 0 4px;
    font-size: 44px;
    font-weight: 700;
    line-height: 1.1;
    word-wrap: break-word;
}
.profile .code { font-size: 26px; opacity: .92; }

.badge {
    position: absolute;
    top: 24px;
    right: 26px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 18px 6px 12px;
    border-radius: 999px;
    font-size: 24px;
    font-weight: 700;
    background: #fff;
    animation: pop .6s .25s cubic-bezier(.2, .9, .3, 1.3) both;
}
.badge svg { width: 26px; height: 26px; }
.badge.ok  { color: var(--ok); }
.badge.bad { color: var(--bad); }

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding: 22px 30px 4px;
}
.stat {
    padding: 14px 10px;
    text-align: center;
    background: var(--g-50);
    border: 1px solid var(--line);
    border-radius: 16px;
    transition: transform .2s, box-shadow .2s;
}
.stat:hover { transform: translateY(-3px); box-shadow: 0 12px 22px -14px rgba(3, 40, 22, .5); }
.stat .k { font-size: 22px; color: var(--muted); }
.stat .v { font-size: 38px; font-weight: 700; color: var(--blue); line-height: 1.1; word-wrap: break-word; }
.stat .v.sm { font-size: 30px; }

.section { padding: 18px 30px 0; }
.section h2 {
    margin: 0 0 12px;
    font-size: 26px;
    color: var(--g-800);
    display: flex;
    align-items: center;
    gap: 10px;
}
.section h2::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, var(--g-100), transparent); }

.schedule { display: grid; gap: 12px; }
.row {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}
.row .ico {
    flex: 0 0 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--g-100), #c4efd6);
    color: var(--g-700);
}
.row .ico svg { width: 26px; height: 26px; }
.row .k { font-size: 22px; color: var(--muted); }
.row .v { font-size: 29px; font-weight: 700; color: var(--ink); }

.notes {
    margin: 18px 30px 0;
    padding: 16px 20px;
    border-radius: 16px;
    background: #fff6f5;
    border: 1px solid #fcd5d1;
    color: #b42318;
    font-size: 24px;
}
.notes strong { display: block; margin-bottom: 4px; }
.notes ol { margin: 0; padding-left: 26px; }

.contact {
    margin: 16px 30px 0;
    font-size: 22px;
    color: var(--muted);
}
.rules { margin: 14px 30px 0; font-size: 23px; color: #0033cc; text-align: center; font-weight: 700; }

.card-foot { padding: 22px 30px 30px; }

/* ---------- not found ---------- */
.notfound { text-align: center; padding: 34px 30px 10px; }
.notfound .circle {
    width: 96px;
    height: 96px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fee2e2;
    color: var(--bad);
    animation: pop .6s cubic-bezier(.2, .9, .3, 1.3) both;
}
.notfound .circle svg { width: 52px; height: 52px; }
.notfound h2 { margin: 0 0 4px; font-size: 38px; color: var(--bad); }
.notfound p  { margin: 0; font-size: 23px; color: var(--muted); }

.footer {
    margin-top: 22px;
    text-align: center;
    font-size: 21px;
    color: rgba(255, 255, 255, .8);
}

/* ---------- responsive ---------- */
@media screen and (max-width: 640px) {
    body { padding: 16px 10px 30px; font-size: 20px; }
    h1.title { font-size: 34px; }
    .subtitle { font-size: 21px; }
    .card-body, .stats, .section { padding-left: 18px; padding-right: 18px; }
    .notes, .contact, .rules { margin-left: 18px; margin-right: 18px; }
    .card-foot { padding-left: 18px; padding-right: 18px; }
    .profile { padding: 22px 18px; }
    .profile .name { font-size: 34px; }
    .badge { position: static; margin-top: 12px; display: inline-flex; }
    .stats { grid-template-columns: 1fr; }
    .stat { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; }
    .stat .v { font-size: 30px; }
}

@media print {
    body { background: #fff; padding: 0; }
    body::before, body::after, .footer, .card-foot, .no-print { display: none !important; }
    .card { box-shadow: none; }
    .profile { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
