/* OMS AMS CMU — หน้าแรก / เข้าสู่ระบบ (ใช้เฉพาะ view ที่ห่อด้วย .auth-page) */
:root {
    --auth-ink: #1e1b4b;
    --auth-muted: #64748b;
    --auth-primary: #6d28d9;
    --auth-primary-2: #4f46e5;
    --auth-ring: rgba(109, 40, 217, .25);
}

.auth-page {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    overflow: auto;
    font-family: 'Noto Sans Thai', 'Sarabun', 'Prompt', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--auth-ink);
    background:
        radial-gradient(1200px 700px at 12% 8%, rgba(167, 139, 250, .55), transparent 60%),
        radial-gradient(900px 600px at 92% 92%, rgba(56, 189, 248, .38), transparent 60%),
        linear-gradient(135deg, #1e1b4b 0%, #3b1a7a 48%, #5b21b6 100%);
}

/* ลวดลายจุดจางๆ */
.auth-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .13) 1px, transparent 1px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 78%);
            mask-image: radial-gradient(ellipse at center, #000 30%, transparent 78%);
    pointer-events: none;
}

/* ก้อนแสงลอย */
.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .55;
    pointer-events: none;
    animation: auth-float 14s ease-in-out infinite;
}
.auth-orb.o1 { width: 340px; height: 340px; background: #a78bfa; top: -90px; left: -60px; }
.auth-orb.o2 { width: 300px; height: 300px; background: #38bdf8; bottom: -80px; right: -40px; animation-delay: -6s; }

@keyframes auth-float {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50%      { transform: translate3d(24px, -28px, 0) scale(1.08); }
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 44px 40px 32px;
    text-align: center;
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(18px);
            backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 28px;
    box-shadow:
        0 30px 60px -20px rgba(15, 10, 50, .55),
        0 0 0 1px rgba(255, 255, 255, .25) inset;
    animation: auth-rise .6s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes auth-rise {
    from { opacity: 0; transform: translateY(18px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

.auth-logo {
    width: 76px;
    height: 76px;
    margin: 0 auto 22px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-primary-2), var(--auth-primary));
    box-shadow: 0 14px 28px -10px rgba(79, 70, 229, .7);
}
.auth-logo svg { width: 38px; height: 38px; }

.auth-title {
    margin: 0 0 6px;
    font-size: clamp(1.9rem, 5vw, 2.4rem);
    font-weight: 800;
    letter-spacing: .01em;
    line-height: 1.15;
    background: linear-gradient(135deg, var(--auth-primary-2), var(--auth-primary));
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
}
.auth-sub {
    margin: 0 0 28px;
    font-size: 1.05rem;
    color: var(--auth-muted);
}
.auth-heading {
    margin: 0 0 4px;
    font-size: 1.5rem;
    font-weight: 700;
}

/* ปุ่ม */
.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff !important;
    text-decoration: none !important;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--auth-primary-2), var(--auth-primary));
    box-shadow: 0 12px 24px -10px rgba(91, 33, 182, .8);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.auth-btn:hover  { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 16px 30px -10px rgba(91, 33, 182, .85); }
.auth-btn:active { transform: translateY(0); }
.auth-btn:focus-visible { outline: 3px solid var(--auth-ring); outline-offset: 3px; }
.auth-btn svg { width: 20px; height: 20px; transition: transform .18s ease; }
.auth-btn:hover svg { transform: translateX(4px); }
.auth-btn[disabled] { opacity: .7; cursor: progress; }

.auth-foot {
    margin: 26px 0 0;
    padding-top: 18px;
    border-top: 1px solid #e8e6f5;
    font-size: .85rem;
    line-height: 1.6;
    color: var(--auth-muted);
}
.auth-back {
    display: inline-block;
    margin-top: 14px;
    font-size: .9rem;
    color: var(--auth-primary);
    text-decoration: none;
}
.auth-back:hover { text-decoration: underline; }

/* ฟอร์ม login */
.auth-card form { text-align: left; }
.auth-card .form-label,
.auth-card .col-form-label { font-weight: 600; font-size: .92rem; color: var(--auth-ink); }
.auth-card .form-control {
    padding: 12px 16px;
    font-size: 1rem;
    background: #f8f7ff;
    border: 1.5px solid #e1defa;
    border-radius: 12px;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-card .form-control:focus {
    background: #fff;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px var(--auth-ring);
}
.auth-card .form-check-input:checked { background-color: var(--auth-primary); border-color: var(--auth-primary); }
.auth-card .mb-3 { margin-bottom: 1rem !important; }
.auth-card .alert { border-radius: 12px; font-size: .92rem; text-align: left; }
.auth-card .invalid-feedback { font-size: .85rem; }
.auth-card .form-group.mt-3 { margin-top: 1.4rem !important; }

@media (max-width: 480px) {
    .auth-card { padding: 36px 24px 26px; border-radius: 22px; }
}
@media (prefers-reduced-motion: reduce) {
    .auth-orb, .auth-card { animation: none; }
    .auth-btn, .auth-btn svg { transition: none; }
}

/* กันขนาดเพี้ยนแม้ Bootstrap ไม่ถูกโหลด */
.auth-page, .auth-page *, .auth-page *::before, .auth-page *::after { box-sizing: border-box; }
.auth-card .form-label, .auth-card .col-form-label { display: block; margin-bottom: .35rem; }
.auth-card .form-control { display: block; width: 100%; }
