/* ==========================================================================
   Page Layer: Auth / Login Specific Styles (ITCSS Layer 4 - BEM: .login-*)
   UI Redesign 100% ຕາມຮູບພາບຕົວຢ່າງ + Split Card Layout + Responsive 100%
   ========================================================================== */

/* 1. ພື້ນຫຼັງໜ້າ Login ແລະ ໄລຍະຫ່າງຂອບເທິງ-ຂອບລຸ່ມ (Top & Bottom Gaps) */
html,
body.auth-body {
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
}

body.auth-body {
    background-color: #881A36;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--font-family-base);
    box-sizing: border-box;
    position: relative;
    overflow-x: hidden;
}

/* ຊັ້ນຮູບພາບພື້ນຫຼັງມົວ (Blur & Maroon Tint Overlay ຕາມຮູບພາບຕົວຢ່າງ) */
body.auth-body::before {
    content: "";
    position: fixed;
    inset: -10px;
    background: linear-gradient(rgba(142, 28, 54, 0.72), rgba(142, 28, 54, 0.78)), url('/assets/images/backgrounds/1750677368957.webp') no-repeat center center;
    background-size: cover;
    filter: blur(1.5px);
    z-index: 0;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   [DESKTOP] ປັບສະເພາະໜ້າຈໍຄອມພິວເຕີ (Desktop > 768px) ບໍ່ກະທົບມືຖື
   -------------------------------------------------------------------------- */
@media (min-width: 769px) {
    body.auth-body {
        padding-top: 60px;
        padding-bottom: 60px;
    }
}

/* 2. Container ຫຼັກຫຸ້ມ Card ແລະ Footer Text */
.login-wrapper {
    position: relative;
    z-index: 1; /* ໃຫ້ເນື້ອຫາ Card ຢູ່ເທິງພື້ນຫຼັງມົວ */
    width: 100%;
    max-width: 840px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    box-sizing: border-box;
}

/* 3. Card ແຍກ 2 ຝັ່ງ (Split Card Container) ຫຼ່ຽມຄົມ Zero border-radius */
.login-card-container {
    width: 100%;
    background-color: #ffffff;
    display: flex;
    flex-direction: row;
    border-radius: 0;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    min-height: 380px;
}

/* 4. ຝັ່ງຊ້າຍ: Brand & Logo Panel (ສີສົ້ມອົບອຸ່ນ #F3A85B ຂະໜາດ 50% ເທົ່າກັນ) */
.login-brand-panel {
    background-color: #F3A85B;
    width: 50%;
    flex: 1;
    padding: 44px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff;
    box-sizing: border-box;
    position: relative;
}

.login-brand-logo {
    width: 78px;
    height: 78px;
    border: 3px solid #ffffff;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    box-sizing: border-box;
    overflow: hidden;
}

.login-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.login-brand-title {
    font-family: inherit;
    font-size: 1.55rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 4px 0;
    line-height: 1.2;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.login-brand-subtitle {
    font-family: inherit;
    font-size: 0.98rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 5px 0;
    line-height: 1.25;
    opacity: 0.98;
}

.login-brand-version {
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
    opacity: 0.95;
}

/* 5. ຝັ່ງຂວາ: Form Panel (ສີຂາວ #ffffff + ເສັ້ນແບ່ງກາງສີເຂັ້ມ 5px) */
.login-form-panel {
    background-color: #ffffff;
    width: 50%;
    flex: 1;
    border-left: 5px solid #CD1644;
    padding: 40px 38px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

.login-form-title {
    font-family: inherit;
    font-size: 1.35rem;
    font-weight: 800;
    color: #CD1644;
    text-align: center;
    margin: 0 0 24px 0;
    letter-spacing: 0.01em;
}

/* Fieldset Inputs ກອບສີຫຼັກ #CD1644 ຫຼ່ຽມຄົມ */
.login-fieldset {
    border: 2px solid #CD1644;
    border-radius: 0;
    padding: 2px 12px 8px 12px;
    margin: 0 0 16px 0;
    background-color: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-fieldset:focus-within {
    border-color: #BD123D;
}

.login-legend {
    color: #CD1644;
    font-size: 0.8125rem; /* 13px */
    font-weight: 700;
    padding: 0 6px;
    margin-left: 6px;
    font-family: inherit;
    letter-spacing: 0.01em;
}

.login-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.login-input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #CD1644;
    flex-shrink: 0;
}

.login-input-icon svg {
    width: 22px;
    height: 22px;
    fill: #CD1644;
    color: #CD1644;
}

.login-input {
    border: none;
    outline: none;
    width: 100%;
    font-family: inherit;
    font-size: 0.9375rem; /* 15px */
    color: #1e293b;
    font-weight: 600;
    padding: 4px 0;
    background: transparent;
}

.login-input::placeholder {
    color: #CD1644;
    opacity: 0.65;
    font-weight: 600;
    font-size: 0.88rem;
}

/* ປຸ່ມສະແດງ/ເຊື່ອງລະຫັດຜ່ານ (Eye Toggle) */
.login-btn-toggle-pwd {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #CD1644;
    transition: color 0.15s ease;
    flex-shrink: 0;
}

.login-btn-toggle-pwd:hover {
    color: #BD123D;
}

.login-btn-toggle-pwd svg {
    stroke: #CD1644;
}

/* Alert ແຈ້ງເຕືອນຂໍ້ຜິດພາດລວມ (ເມື່ອຜິດທັງສອງ) */
.login-alert {
    background-color: #fef2f2;
    border-left: 4px solid #dc2626;
    color: #991b1b;
    padding: 10px 14px;
    font-size: 0.88rem;
    font-weight: 700;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
    border-radius: 0;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.08);
}

.login-alert svg {
    color: #dc2626;
    flex-shrink: 0;
}

/* ສະຖານະ Input / Fieldset ເມື່ອປ້ອນຜິດ (Validation Error State) */
.login-fieldset.is-invalid {
    border-color: #dc2626 !important;
    background-color: #fffbfa !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2) !important;
}

.login-fieldset.is-invalid .login-legend {
    color: #dc2626 !important;
}

.login-fieldset.is-invalid .login-input-icon svg {
    color: #dc2626 !important;
    fill: #dc2626 !important;
}

.login-fieldset.is-invalid .login-btn-toggle-pwd svg {
    stroke: #dc2626 !important;
}

.login-fieldset.is-invalid .login-input {
    color: #dc2626 !important;
}

.login-field-error {
    color: #dc2626;
    font-size: 0.8125rem;
    font-weight: 700;
    margin: -10px 0 14px 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.3;
}

/* 6. ແຖວ Options: ຈື່ຂ້ອຍໄວ້ & ລືມລະຫັດຜ່ານ */
.login-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 6px 0 22px 0;
    font-size: 0.875rem;
    font-weight: 700;
}

.login-remember-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    color: #1e293b;
    font-weight: 700;
}

.login-checkbox {
    width: 17px;
    height: 17px;
    accent-color: #CD1644;
    border-radius: 0;
    cursor: pointer;
    margin: 0;
}

.login-forgot-link {
    color: #CD1644;
    text-decoration: none;
    transition: color 0.15s ease;
    font-weight: 700;
}

.login-forgot-link:hover {
    color: #BD123D;
    text-decoration: underline;
}

/* 7. ປຸ່ມກົດເຂົ້າສູ່ລະບົບ (Submit Button ໂທນສີຫຼັກ #CD1644 ຫຼ່ຽມຄົມ) */
.login-btn-submit {
    background-color: #CD1644;
    color: #ffffff;
    border: none;
    border-radius: 0;
    height: 48px;
    width: 100%;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.01em;
}

.login-btn-submit:hover {
    background-color: #BD123D;
    transform: translateY(-1px);
}

.login-btn-submit:active {
    transform: translateY(0);
}

.login-btn-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-btn-icon-box svg {
    width: 22px;
    height: 22px;
    stroke: #ffffff;
    stroke-width: 2.4;
}

/* 8. ຂໍ້ຄວາມສະຫງວນລິຂະສິດດ້ານລຸ່ມ (Bottom Footer Text) ຈັດກາງ 100% ຕາມຮູບພາບ */
.login-footer-text-box {
    margin-top: 24px;
    text-align: center;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
}

.login-footer-text-main {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
    text-align: center;
}

.login-footer-text-copy {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    letter-spacing: 0.01em;
    opacity: 0.98;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    text-align: center;
}

/* ==========================================================================
   Responsive Styles 100% Mobile & Tablet (RULE-FE-01)
   ========================================================================== */
@media (max-width: 768px) {
    body.auth-body {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 24px 14px;
        box-sizing: border-box;
    }

    .login-wrapper {
        width: 100%;
        max-width: 380px;
        margin: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .login-card-container {
        flex-direction: column;
        width: 100%;
        max-width: 380px;
        min-height: auto;
    }

    .login-brand-panel {
        width: 100%;
        padding: 28px 20px 24px 20px;
    }

    .login-brand-logo {
        width: 64px;
        height: 64px;
        margin-bottom: 14px;
    }

    .login-brand-title {
        font-size: 1.35rem;
        margin: 0 0 2px 0;
        line-height: 1.2;
    }

    .login-brand-subtitle {
        font-size: 0.9rem;
        margin: 0 0 3px 0;
        line-height: 1.25;
    }

    .login-brand-version {
        font-size: 0.85rem;
    }

    .login-form-panel {
        width: 100%;
        border-left: none;
        border-top: 5px solid #CD1644; /* ເສັ້ນ Border ຂັ້ນກາງ 5px ຄືກັບ Desktop */
        padding: 28px 20px;
    }

    .login-form-title {
        font-size: 1.2rem;
        margin-bottom: 18px;
    }

    .login-footer-text-box {
        margin-top: 20px;
    }

    .login-footer-text-main {
        font-size: 0.9375rem;
    }

    .login-footer-text-copy {
        font-size: 0.85rem;
    }
}
