@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@400;500;600&display=swap');

html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 20px;
    color: #392733;
    background: #fcf5f8;
    font: 400 16px/1.55 "Kanit", "Noto Sans Thai", system-ui, sans-serif;
}
/* ปรับสีโลโก้เป็นสีดำ */
body::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background-image: url('../images/logo.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.05;
    z-index: 0;
    filter: brightness(0%); /* เพิ่ม filter เพื่อทำให้โลโก้เป็นสีดำ */
}
.login-container { width: min(100%, 420px);    margin: auto;
    position: relative;
    z-index: 1; }
.login-box {
    padding: clamp(20px, 6vw, 36px);
    border: 1px solid #ead7e1;
    border-top: 4px solid #f2b6ce;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(88, 40, 67, .09);
}

.login-box h2 {
    margin: 0 0 24px;
    color: #50243e;
    text-align: center;
    font-size: clamp(22px, 5vw, 29px);
    font-weight: 600;
}

.form-group { margin-bottom: 17px; }
.form-group label { display: block; margin-bottom: 5px; font-size: 14px; font-weight: 500; }

.form-group input {
    width: 100%;
    min-height: 46px;
    padding: 8px 12px;
    border: 1px solid #e2c9d7;
    border-radius: 8px;
    color: #392733;
    background: #fff8fb;
    font: inherit;
}

.form-group input:focus { border-color: #aa4c77; outline: 2px solid #eeb4ce; outline-offset: 1px; }
.btn-login {
    width: 100%;
    min-height: 46px;
    padding: 9px 16px;
    border: 0;
    border-radius: 8px;
    color: #4a2038;
    background: #f2b6ce;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}

.btn-login:hover { background: #eca3c0; }
.btn-login:focus-visible { outline: 2px solid #aa4c77; outline-offset: 3px; }

.login-page, .error-page {
    background: linear-gradient(180deg, #f8d8e6 0 34%, #fcf5f8 34% 100%);
}
.login-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; color: #7d3157; font-weight: 500; }
.login-brand img { padding: 3px; border: 1px solid #ead7e1; border-radius: 9px; object-fit: contain; }
.login-box h1 { margin: 0 0 22px; color: #50243e; font-size: clamp(22px, 5vw, 29px); font-weight: 600; line-height: 1.3; }
.public-footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 5px; margin-top: 16px; color: #6f5263; font-size: 13px; text-align: center; }
.public-footer span { margin-inline-start: 6px; }
.public-footer a { color: #7d3157; text-underline-offset: 2px; }
.error-code { margin: 0 0 3px; color: #7d3157; font-size: clamp(48px, 14vw, 84px); font-weight: 600; line-height: 1; }
.error-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.error-actions .btn-login, .btn-back { width: auto; display: inline-grid; place-items: center; text-decoration: none; }
.btn-back { min-height: 46px; padding: 8px 12px; border: 1px solid #e2c9d7; border-radius: 8px; background: #fff8fb; color: #392733; font: inherit; cursor: pointer; }
.btn-back:hover { background: #fae4ee; }
.btn-back:focus-visible { outline: 2px solid #aa4c77; outline-offset: 2px; }
