/**
 * ======================================================================
 * ໄຟລ໌: assets/css/login.css
 * ໜ້າທີ່: ສະໄຕລ໌ໜ້າເຂົ້າສູ່ລະບົບ (auth/login.php).
 * ແບບ: ພື້ນຫຼັງສີຟ້າ, ບັດສີຂາວ, ແຜງຊ້າຍສີຟ້າທີ່ຂອບຂວາໂຄ້ງ, ລູກບານຕົກແຕ່ງ 3 ໜ່ວຍ,
 * ຊ່ອງປ້ອນສີເທົາອ່ອນ, ປຸ່ມສີຟ້າເຂັ້ມ. ໂທລະສັບ: ແຜງສີຟ້າຢູ່ເທິງ (ຂອບລຸ່ມໂຄ້ງ), ຟອມຢູ່ລຸ່ມ,
 * ພໍດີໜ້າຈໍດຽວ.
 * ======================================================================
 */

:root {
    --lg-blue-0: #0d3f84;
    --lg-blue-1: #1554ad;
    --lg-blue-2: #1f6bd0;
    --lg-blue-3: #4a8fe6;
    --lg-btn: #154a8c;
    --lg-btn-hover: #0f3d76;

    --lg-card: #ffffff;
    --lg-text: #1c2a3f;
    --lg-muted: #7a8699;
    --lg-input-bg: #f1f3f6;
    --lg-input-border: #e3e7ed;
    --lg-error-bg: #fdecec;
    --lg-error-text: #b42318;
    --lg-warn-bg: #fff6e5;
    --lg-warn-text: #92580c;
}

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

*:not(.fas):not(.far):not(.fab):not(.fa) {
    font-family: 'Nuanta', 'Souliyo', 'Boon', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(180deg, var(--lg-blue-2) 0%, var(--lg-blue-1) 55%, var(--lg-blue-0) 100%);
    color: var(--lg-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
}

/* ---------- Card ---------- */
.login-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 900px;
    min-height: 520px;
    display: flex;
    background: var(--lg-card);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 30px 60px -20px rgba(6, 30, 70, 0.55);
}

/* ---------- Decorative spheres ---------- */
.lg-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}
/* large quarter-circle peeking in at the bottom-left of the blue panel */
.lg-orb-left {
    width: 250px; height: 250px;
    left: -110px; bottom: -120px;
    background: radial-gradient(circle at 70% 30%, var(--lg-blue-2) 0%, var(--lg-blue-1) 60%, var(--lg-blue-0) 100%);
    box-shadow: 12px -10px 30px rgba(6, 30, 70, 0.25);
}
/* the big sphere sitting on the curved edge, bottom-centre */
.lg-orb-mid {
    width: 190px; height: 190px;
    left: calc(45% - 120px); bottom: -46px;
    background: radial-gradient(circle at 32% 28%, var(--lg-blue-3) 0%, var(--lg-blue-2) 38%, var(--lg-blue-0) 100%);
    box-shadow: 0 18px 40px rgba(6, 30, 70, 0.35);
}
/* small quarter-circle in the bottom-right corner of the white side */
.lg-orb-right {
    width: 130px; height: 130px;
    right: -46px; bottom: -46px;
    background: radial-gradient(circle at 30% 30%, var(--lg-blue-3) 0%, var(--lg-blue-1) 70%);
}

/* ---------- Blue panel: its right edge bulges into the white side ---------- */
.login-brand {
    flex: 0 0 47%;
    position: relative;
    z-index: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 44px 70px 90px 52px;
    color: #fff;
    background: linear-gradient(160deg, var(--lg-blue-2) 0%, var(--lg-blue-1) 60%, var(--lg-blue-0) 100%);
    border-radius: 0 50% 40% 0 / 0 55% 45% 0;
}
.login-brand > * { position: relative; z-index: 2; }
.login-brand-logo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: #fff;
    padding: 4px;
    margin-bottom: 20px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}
.login-brand-logo img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: contain;   /* shop logos come in any shape — never crop them */
    display: block;
}
.login-brand-welcome {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.login-brand-name {
    margin: 4px 0 14px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
    /* no uppercase: the system name is written "Wlaodev POS" everywhere */
    color: rgba(255, 255, 255, 0.92);
}
.login-brand-desc {
    margin: 0;
    max-width: 290px;
    font-size: 0.8rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.72);
}

/* ---------- Form panel ---------- */
.login-form-panel {
    flex: 1 1 auto;
    position: relative;
    z-index: 2;
    padding: 56px 64px 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-form-panel h1 {
    margin: 0 0 4px;
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--lg-text);
}
.login-form-panel .login-sub {
    margin: 0 0 26px;
    color: var(--lg-muted);
    font-size: 0.85rem;
}

/* Language switcher */
.lang-switch { position: absolute !important; top: 18px; right: 18px; z-index: 5 !important; }
.lang-switch-btn {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; padding: 0;
    border: 2px solid var(--lg-input-border); border-radius: 50%;
    background: #fff; cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.lang-switch-btn:hover { border-color: var(--lg-blue-2); box-shadow: 0 0 0 4px rgba(31, 107, 208, 0.12); }
.lang-switch-btn img,
.lang-switch-menu img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; display: block; }
.lang-switch-menu {
    display: none;
    position: absolute; right: 0; top: 44px; z-index: 10;
    background: #fff; border: 1px solid var(--lg-input-border); border-radius: 4px;
    padding: 6px; box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
    min-width: 150px; transform-origin: top right;
}
.lang-switch.open .lang-switch-menu { display: block; animation: langMenuDrop 0.18s ease-out; }
@keyframes langMenuDrop {
    from { opacity: 0; transform: translateY(-8px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .lang-switch.open .lang-switch-menu { animation: none; }
}
.lang-switch-menu button {
    display: flex; align-items: center; gap: 8px; width: 100%;
    border: 0; background: transparent; padding: 6px 10px; border-radius: 4px;
    cursor: pointer; font-size: 0.88rem; color: var(--lg-text); white-space: nowrap;
}
.lang-switch-menu button:hover,
.lang-switch-menu button.active { background: var(--lg-input-bg); }

/* Fields: flat grey boxes with the icon on the left, label kept for screen readers */
.lg-field { margin-bottom: 16px; }
.lg-field label {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}
.lg-input-wrap { position: relative; }
.lg-input-wrap .lg-icon {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    color: #3b4656; font-size: 1rem; pointer-events: none;
    transition: color 0.15s;
}
.lg-input {
    width: 100%; height: 50px;
    padding: 0 48px 0 46px;
    border: 1px solid var(--lg-input-border); border-radius: 4px;
    background: var(--lg-input-bg); color: var(--lg-text);
    font-size: 0.95rem; outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.lg-input::placeholder { color: #8a94a3; }
.lg-input:focus {
    border-color: var(--lg-blue-2);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(31, 107, 208, 0.15);
}
.lg-input-wrap:focus-within .lg-icon { color: var(--lg-blue-1); }
.lg-toggle-pass {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; border: 0; background: transparent;
    color: var(--lg-blue-1); cursor: pointer; border-radius: 4px;
}
.lg-toggle-pass:hover { background: #e4ecf8; }

.lg-alert {
    display: none;
    align-items: flex-start; gap: 8px;
    margin-bottom: 16px; padding: 10px 14px;
    border-radius: 4px; font-size: 0.88rem;
    background: var(--lg-error-bg); color: var(--lg-error-text);
}
.lg-alert.show { display: flex; }
.lg-alert.warn { background: var(--lg-warn-bg); color: var(--lg-warn-text); }
.lg-alert i { margin-top: 3px; }

.lg-btn {
    width: 100%; height: 50px; margin-top: 10px;
    border: 0; border-radius: 4px;
    background: var(--lg-btn);
    color: #fff;
    font-size: 1rem; font-weight: 700; cursor: pointer;
    box-shadow: 0 10px 20px -10px rgba(13, 63, 132, 0.7);
    transition: background 0.15s, box-shadow 0.15s, transform 0.05s;
}
.lg-btn i { margin-right: 4px; }
.lg-btn:hover { background: var(--lg-btn-hover); }
.lg-btn:active { transform: translateY(1px); }
.lg-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(31, 107, 208, 0.35); }
.lg-btn:disabled { opacity: 0.75; cursor: wait; }

/* Footer: copyright only (no phone number, no website) */
.bct-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-top: 20px;
}
.bct-footer-copy {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

/* ---------- Phone: blue header on top (curved bottom edge), form below ---------- */
@media (max-width: 760px) {
    body { padding: 18px 14px; justify-content: flex-start; }
    .login-shell { flex-direction: column; max-width: 440px; min-height: 0; margin-top: 6px; }
    .login-brand {
        flex-basis: auto;
        align-items: center; text-align: center;
        padding: 28px 22px 46px;
        border-radius: 0 0 55% 45% / 0 0 34px 34px;
    }
    .login-brand-logo { width: 60px; height: 60px; margin-bottom: 12px; }
    .login-brand-welcome { font-size: 1.4rem; }
    .login-brand-name { margin-bottom: 0; font-size: 0.95rem; }
    .login-brand-desc { display: none; }
    .lg-orb-left, .lg-orb-mid { display: none; }
    .lg-orb-right { width: 90px; height: 90px; right: -36px; bottom: -36px; }
    .login-form-panel { padding: 22px 22px 34px; }
    .login-form-panel h1 { font-size: 1.45rem; }
    .login-form-panel .login-sub { margin-bottom: 18px; }
    .lang-switch { top: 12px; right: 12px; }
}

/* ---------- Phone: the whole login fits one screen, no scrollbar at the side ---------- */
@media (max-width: 760px) {
    /* Locked in place: the page never scrolls, drags or bounces (pull-to-refresh / rubber band) */
    html, body { height: 100%; overflow: hidden; overscroll-behavior: none; scrollbar-width: none; -ms-overflow-style: none; }
    html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }
    body { position: fixed; inset: 0; width: 100%; height: 100dvh; min-height: 0; padding: 10px 12px; justify-content: center; touch-action: manipulation; }
    .lg-btn:active { transform: none; }
    .login-shell { margin-top: 0; }
    .lang-switch-btn { width: 32px; height: 32px; }
    .lang-switch-btn img { width: 22px; height: 22px; }
    .lg-field { margin-bottom: 12px; }
    .lg-input { height: 46px; }
    .lg-btn { height: 48px; margin-top: 6px; }
    .bct-footer { margin-top: 12px; }
    .bct-footer-copy { font-size: 0.75rem; }
}
/* keyboard open (the visible height drops to ~400px): hide the blue header so the
   fields and the button stay above the keyboard */
@media (max-width: 760px) and (max-height: 520px) {
    body { justify-content: flex-start; padding-top: 8px; }
    .login-brand { display: none; }
    .bct-footer { display: none; }
    .login-form-panel { padding-top: 16px; }
}
/* short phones: drop the welcome line and shrink the logo */
@media (max-width: 760px) and (max-height: 700px) {
    .login-brand-welcome { display: none; }
    .login-brand-logo { width: 48px; height: 48px; margin-bottom: 6px; }
    .login-brand { padding-top: 14px; padding-bottom: 34px; }
}
