:root {
    /* สีจากโลโก้ BEE CREW PRO: กรมท่า + เหลืองอำพัน */
    --navy: #051c3c;
    --amber: #fbb102;
    --amber-deep: #b97f00;
    --bg: #f3f5f9;
    --line: #d5dbe5;
    --text: #0f1f38;
    --muted: #5b6678;
    --error: #b42318;
    --ok: #1f7a3a;
    --radius: 6px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; min-height: 100vh; min-height: 100dvh;
    display: flex; align-items: center; justify-content: center;
    padding: 24px 16px;
    font-family: "Sarabun", system-ui, sans-serif; font-size: 16px; line-height: 1.5;
    color: var(--text); background: var(--bg);
}

/* ---------- กล่องฟอร์ม: พื้นขาว เส้นขอบบาง ไม่มีเงา ---------- */
.card {
    width: 100%; max-width: 420px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden;
}
.card-body { padding: 24px 28px 8px; }

.brand {
    display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
    padding: 22px 28px 16px;
    border-bottom: 3px solid var(--amber);
}
.logo { display: block; width: 100%; max-width: 210px; height: auto; }
.company { color: var(--muted); font-weight: 600; font-size: .9rem; line-height: 1.3; }

h1 { margin: 0 0 20px; font-size: 1.3rem; line-height: 1.35; color: var(--navy); }
.lead { margin: -14px 0 20px; color: var(--muted); }

/* ---------- ช่องกรอก ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 6px; font-weight: 600; font-size: .95rem; }
.field label .icon { display: none; }
.field input {
    display: block; width: 100%; min-height: 46px; padding: 10px 12px;
    font: inherit; color: var(--text);
    background: #fff; border: 1px solid #b8c0cc; border-radius: var(--radius);
    appearance: none; -webkit-appearance: none;
}
.field input:hover { border-color: var(--muted); }
.field input:focus { outline: 2px solid var(--amber); outline-offset: 1px; border-color: var(--navy); }
.field-error { display: none; margin: 6px 0 0; color: var(--error); font-size: .9rem; }
.has-error input { border-color: var(--error); }
.has-error .field-error { display: block; }

/* ---------- ปุ่ม ---------- */
.btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; min-height: 48px; margin: 24px 0 8px; padding: 12px;
    font: inherit; font-size: 1.05rem; font-weight: 700;
    color: #fff; text-decoration: none;
    background: var(--navy); border: 0; border-radius: var(--radius);
    cursor: pointer;
}
.btn:hover { background: #0d2c59; }
.btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.spinner {
    display: none; width: 18px; height: 18px; border-radius: 50%;
    border: 3px solid rgba(255,255,255,.3); border-top-color: #fff;
    animation: spin .7s linear infinite;
}
.btn.loading { pointer-events: none; opacity: .75; }
.btn.loading .spinner { display: inline-block; }

/* ---------- แจ้งเตือน ---------- */
.alert { padding: 10px 12px; border-radius: var(--radius); margin-bottom: 18px; font-size: .95rem; }
.alert.error { background: #fdecea; color: var(--error); border: 1px solid #f5c2bc; }
.alert.success { background: #e7f5ea; color: var(--ok); border: 1px solid #bfe3c8; }

/* ---------- ท้ายการ์ด ---------- */
.tagline { padding: 12px 28px 18px; color: var(--muted); font-size: .85rem; }
.tagline span { color: var(--amber-deep); margin: 0 3px; }
.tagline .site { margin-top: 2px; font-size: .78rem; color: #8a94a6; }

@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition: none !important; }
}

@media (max-width: 480px) {
    body { padding: 0; align-items: stretch; background: #fff; }
    .card { max-width: none; border: 0; border-radius: 0; display: flex; flex-direction: column; min-height: 100dvh; }
    .card-body { padding: 24px 16px 8px; flex: 1; }
    .brand { padding: 18px 16px 14px; }
    .tagline { padding: 12px 16px 18px; }
}
