/**
 * ======================================================================
 * ໄຟລ໌: assets/css/login.css
 * ໜ້າທີ່: ສະໄຕລ໌ໜ້າເຂົ້າສູ່ລະບົບ (auth/login.php).
 * ສ່ວນຕ່າງໆ: ພື້ນຫຼັງສີກົມທ່າ, ບັດ, ແຜງສີກົມທ່າ, ຂອບຮູບເມກ, ຟອມ, ຕົວປ່ຽນພາສາ, ທ້າຍໜ້າ,
 * ແລະ ການຈັດວາງສຳລັບໂທລະສັບ (ແຜງຢູ່ເທິງ, ຟອມຢູ່ລຸ່ມ, ພໍດີໜ້າຈໍດຽວ).
 * ======================================================================
 */
/* ============================================================
   login.css — ໜ້າເຂົ້າສູ່ລະບົບ: ບັດແບ່ງ 2 ຟາກ, ຂອບເມກ (cloud edge) ລະຫວ່າງ
   ແຖບສີກົມທ່າ ແລະ ຟອມສີຂາວ. Desktop: navy left / form right, clouds run down
   the seam. Phone: navy header on top, clouds along its bottom, form below.
   Colours: the app's navy (#244886).
   ============================================================ */

:root {
    --lg-navy-0: #13274d;
    --lg-navy-1: #1b3869;
    --lg-navy-2: #244886;
    --lg-accent: #3b6fc4;

    --lg-card: #ffffff;
    --lg-text: #0f172a;
    --lg-muted: #64748b;
    --lg-input-bg: #eef3fb;
    --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: 'Noto Sans Lao', '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: #0b1730;
    color: var(--lg-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
}

/* ---------- Page background: navy gradient, soft colour glows, faint dot grid ---------- */
.lg-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1.4px) 0 0 / 22px 22px,
        linear-gradient(160deg, #0b1730 0%, #13274d 45%, #244886 100%);
}
.lg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.55;
}
.lg-glow-1 { width: 460px; height: 460px; top: -140px; left: -120px; background: #2f6fe0; }
.lg-glow-2 { width: 420px; height: 420px; bottom: -160px; right: -100px; background: #6d4ee8; opacity: 0.45; }
.lg-glow-3 { width: 300px; height: 300px; top: 40%; left: 55%; background: #14b8a6; opacity: 0.18; }

/* ---------- Card ---------- */
.login-shell {
    z-index: 10;
    position: relative;
    width: 100%;
    max-width: 940px;
    min-height: 560px;
    display: flex;
    background: var(--lg-card);
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 30px 70px -24px rgba(19, 39, 77, 0.45), 0 2px 8px rgba(19, 39, 77, 0.06);
}

/* ---------- Navy panel ---------- */
.login-brand {
    flex: 0 0 46%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 44px 120px 44px 36px;   /* extra right padding: the cloud edge reaches ~115px in */
    color: #fff;
    background:
        radial-gradient(circle at 25% 15%, rgba(91, 141, 239, 0.35) 0%, transparent 55%),
        linear-gradient(160deg, var(--lg-navy-0) 0%, var(--lg-navy-2) 100%);
}
.login-brand-welcome {
    font-size: 1.25rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 26px;
}
.login-brand-logo {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background: #fff;
    padding: 6px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3), 0 0 0 8px rgba(255, 255, 255, 0.1);
}
.login-brand-logo img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.login-brand-name {
    margin: 18px 0 4px;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.3px;
}

/* ---------- Cloud edges ---------- */
.lg-cloud { position: absolute; pointer-events: none; display: block; }
/* Desktop: down the seam, its lobes reaching up to ~115px into the navy panel */
.lg-cloud-v { top: 0; bottom: 0; left: -150px; width: 170px; height: 100%; z-index: 1; }
/* Phone: along the bottom of the navy header */
.lg-cloud-h { display: none; left: 0; right: 0; bottom: -1px; width: 100%; height: 80px; }

/* ---------- Form panel ---------- */
.login-form-panel {
    flex: 1 1 auto;
    position: relative;
    padding: 52px 56px 44px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.login-form-panel > *:not(.lg-cloud) { position: relative; z-index: 2; }

.login-form-panel h1 {
    margin: 0 0 6px;
    text-align: center;
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--lg-text);
}
.login-form-panel .login-sub {
    margin: 0 0 30px;
    text-align: center;
    color: var(--lg-muted);
    font-size: 0.93rem;
}

/* 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: 38px; height: 38px; padding: 0;
    border: 2px solid #dbe3ee; border-radius: 50%;
    background: #fff; cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.lang-switch-btn:hover { border-color: var(--lg-accent); box-shadow: 0 0 0 4px rgba(59, 111, 196, 0.12); }
.lang-switch-btn img,
.lang-switch-menu img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: block; }
.lang-switch-menu {
    display: none;
    position: absolute; right: 0; top: 46px; z-index: 10;
    background: #fff; border: 1px solid #dbe3ee; border-radius: 12px;
    padding: 6px; box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}
.lang-switch.open .lang-switch-menu { display: block; }
.lang-switch-menu button {
    display: flex; align-items: center; gap: 8px; width: 100%;
    border: 0; background: transparent; padding: 6px 10px; border-radius: 8px;
    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: soft filled inputs, no heavy border */
.lg-field { margin-bottom: 18px; }
.lg-field label {
    display: block; margin-bottom: 7px;
    font-size: 0.9rem; font-weight: 700; color: #334155;
}
.lg-input-wrap { position: relative; }
.lg-input-wrap .lg-icon {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    color: #94a3b8; font-size: 0.95rem; pointer-events: none;
    transition: color 0.15s;
}
.lg-input {
    width: 100%; height: 52px;
    padding: 0 46px 0 46px;
    border: 1.5px solid transparent; border-radius: 12px;
    background: var(--lg-input-bg); color: var(--lg-text);
    font-size: 1rem; outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.lg-input::placeholder { color: #9aa8bc; }
.lg-input:focus {
    border-color: var(--lg-accent);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 111, 196, 0.15);
}
.lg-input-wrap:focus-within .lg-icon { color: var(--lg-accent); }
.lg-toggle-pass {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; border: 0; background: transparent;
    color: #94a3b8; cursor: pointer; border-radius: 9px;
}
.lg-toggle-pass:hover { color: var(--lg-navy-2); background: #e3ebf8; }

.lg-alert {
    display: none;
    align-items: flex-start; gap: 8px;
    margin-bottom: 18px; padding: 10px 14px;
    border-radius: 11px; font-size: 0.9rem;
    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: 54px; margin-top: 12px;
    border: 0; border-radius: 12px;
    background: linear-gradient(135deg, var(--lg-accent) 0%, var(--lg-navy-2) 100%);
    color: #fff;
    font-size: 1.05rem; font-weight: 700; cursor: pointer;
    box-shadow: 0 12px 24px -8px rgba(36, 72, 134, 0.6);
    transition: filter 0.15s, box-shadow 0.15s, transform 0.05s;
}
.lg-btn i { margin-right: 4px; }
.lg-btn:hover { filter: brightness(1.08); box-shadow: 0 16px 28px -8px rgba(36, 72, 134, 0.7); }
.lg-btn:active { transform: translateY(1px); }
.lg-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(59, 111, 196, 0.35); }
.lg-btn:disabled { opacity: 0.75; cursor: wait; }

/* Footer (same content as before) — light text on the dark background */
.bct-footer {
    position: relative;
    z-index: 10;
    text-align: center;
    margin-top: 22px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.82rem;
    line-height: 1.6;
}
.bct-footer-copy {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}
.bct-footer-copy a {
    color: #9cc0ff;
    font-weight: 700;
    text-decoration: none;
}
.bct-footer-copy a:hover { color: #ffffff; text-decoration: underline; }
.bct-social-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}
.bct-social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
}
.bct-social-link:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.bct-social-link i.fa-facebook { color: #5b9dff; font-size: 1rem; }
.bct-social-link i.fa-whatsapp { color: #25d366; font-size: 1.05rem; }

/* ---------- Phone: navy header on top with clouds along its bottom, 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; border-radius: 26px; }
    .login-brand { flex-basis: auto; padding: 28px 22px 84px; }   /* bottom room for the clouds */
    .login-brand-welcome { font-size: 1rem; margin-bottom: 14px; }
    .login-brand-logo { width: 92px; height: 92px; }
    .login-brand-name { margin-top: 12px; font-size: 1.3rem; }
    .lg-cloud-v { display: none; }
    .lg-cloud-h { display: block; }
    .login-form-panel { padding: 14px 22px 28px; }
    .login-form-panel h1 { font-size: 1.35rem; }
    .login-form-panel .login-sub { margin-bottom: 22px; }
    .lang-switch { top: 12px; right: 12px; }
}

/* ---------- Phone: the whole login fits one screen, no scrollbar at the side ----------
   Stacked, the card + footer came to ~840px — taller than a phone, so the page scrolled. Compact
   header, fields and footer bring it inside the screen; if a very short screen still has to
   scroll, it scrolls without showing a bar. */
@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; border-radius: 22px; }
    .login-brand { padding: 16px 18px 46px; }
    .login-brand-welcome { font-size: 0.9rem; margin-bottom: 8px; }
    .login-brand-logo { width: 64px; height: 64px; padding: 4px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), 0 0 0 5px rgba(255, 255, 255, 0.1); }
    .login-brand-name { margin: 8px 0 0; font-size: 1.1rem; }
    .lg-cloud-h { height: 44px; }
    .login-form-panel { padding: 6px 20px 20px; }
    .login-form-panel h1 { font-size: 1.2rem; margin-bottom: 2px; }
    .login-form-panel .login-sub { margin-bottom: 14px; font-size: 0.85rem; }
    .lg-field { margin-bottom: 12px; }
    .lg-field label { margin-bottom: 5px; font-size: 0.85rem; }
    .lg-input { height: 46px; }
    .lg-btn { height: 48px; margin-top: 6px; }
    .lang-switch-btn { width: 34px; height: 34px; }
    .lang-switch-btn img { width: 24px; height: 24px; }
    .bct-footer { margin-top: 12px; font-size: 0.75rem; line-height: 1.4; }
    .bct-footer-copy { font-size: 0.75rem; margin-bottom: 4px; }
    .bct-social-links { gap: 6px; margin-top: 2px; }
    .bct-social-link { padding: 3px 10px; font-size: 0.75rem; }
}
/* keyboard open (the visible height drops to ~400px): the page can't scroll, so hide the navy header
   and put the form at the top, keeping both fields and the button 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: 14px; }
}
/* short phones (landscape / small screens): drop the welcome line and shrink the logo further */
@media (max-width: 760px) and (max-height: 700px) {
    .login-brand-welcome { display: none; }
    .login-brand-logo { width: 52px; height: 52px; }
    .login-brand { padding-top: 12px; padding-bottom: 40px; }
}
