﻿/* ==========================================================================
   LOGIN PAGE STYLESHEET - GPSTRACKING APP APPLICATION
   --------------------------------------------------------------------------
   Định dạng giao diện trang đăng nhập hiện đại, responsive cho mọi thiết bị:
   hiệu ứng nền ánh sáng ambient glow, thẻ glassmorphic card, trường nhập liệu
   kèm icon, trạng thái xác thực cấp 2 (2FA) và chân trang chuẩn doanh nghiệp.

   MỤC LỤC:
   01. NỀN & KHUNG TRANG TOÀN DIỆN (Background Canvas & Ambient Glow)
   02. THẺ CARD ĐĂNG NHẬP (Glassmorphic Container & Brand Header)
   03. TRƯỜNG NHẬP LIỆU & BIỂU MẪU (Modern Inputs & Prefix Icons)
   04. NÚT ẨN/HIỆN MẬT KHẨU (Password Visibility Toggle)
   05. GHI NHỚ MẬT KHẨU & TÙY CHỌN (Remember Me & Checkbox)
   06. NÚT ĐĂNG NHẬP & HIỆU ỨNG TẢI (Submit Buttons & Loading)
   07. THÔNG BÁO LỖI & PHẢN HỒI (Alert Badges & Errors)
   08. GIAO DIỆN XÁC THỰC CẤP 2 (Step 2 2FA Security Badge)
   09. CHÂN TRANG & BẢN QUYỀN (Footer Trust Badge & Copyright)
   10. THIẾT KẾ ĐÁP ỨNG DI ĐỘNG (Mobile Responsive Breakpoints)
   ========================================================================== */


/* ==========================================================================
   01. NỀN & KHUNG TRANG TOÀN DIỆN (Background Canvas & Ambient Glow)
   ========================================================================== */

body {
    background: radial-gradient(circle at 15% 15%, rgba(61, 182, 235, 0.28) 0%, transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(0, 152, 218, 0.38) 0%, transparent 45%),
        linear-gradient(145deg, #0284c7 0%, #0098DA 45%, #3DB6EB 100%);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 1.5rem 1rem;
    box-sizing: border-box;
    position: relative;
    overflow-x: hidden;
    overscroll-behavior: none;
    overscroll-behavior-y: none;
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
}

/* Đốm sáng trang trí mờ phía sau tạo chiều sâu */
body::before,
body::after {
    content: "";
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

body::before {
    top: -60px;
    left: -60px;
    background: #38bdf8;
}

body::after {
    bottom: -60px;
    right: -60px;
    background: #0369a1;
}


/* ==========================================================================
   02. THẺ CARD ĐĂNG NHẬP (Glassmorphic Container & Brand Header)
   ========================================================================== */

.login-container {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2.25rem 2rem;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 20px 50px rgba(0, 45, 90, 0.24), 0 4px 12px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Khối thương hiệu & Logo đầu thẻ card */
.login-brand-wrap {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-brand-logo {
    max-width: 200px;
    height: auto;
    max-height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
    margin-bottom: 0.4rem;
}

.login-brand-subtitle {
    font-size: 12.5px;
    color: #64748b;
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.2px;
}


/* ==========================================================================
   03. TRƯỜNG NHẬP LIỆU & BIỂU MẪU (Modern Inputs & Prefix Icons)
   ========================================================================== */

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.4rem;
    display: block;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .input-icon {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    font-size: 14px;
    pointer-events: none;
    transition: color 0.2s ease;
    z-index: 2;
}

.input-wrapper .form-control {
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background-color: #f8fafc;
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    font-size: 12px;
    color: #0f172a;
    transition: all 0.2s ease;
    width: 100%;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.input-wrapper .form-control:focus {
    background-color: #ffffff;
    border-color: #0098DA;
    box-shadow: 0 0 0 3.5px rgba(0, 152, 218, 0.18);
    outline: none;
}

.input-wrapper:focus-within .input-icon {
    color: #0098DA;
}

.input-wrapper .form-control::placeholder {
    color: #94a3b8;
    font-size: 13px;
}


/* ==========================================================================
   04. NÚT ẨN/HIỆN MẬT KHẨU (Password Visibility Toggle)
   ========================================================================== */

.password-container .form-control {
    padding-right: 3rem !important;
}

.btn-toggle-password {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    padding: 6px 10px;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-toggle-password:hover {
    color: #0098DA;
    background-color: rgba(0, 152, 218, 0.08);
}

.btn-toggle-password:focus {
    outline: none;
}


/* ==========================================================================
   05. GHI NHỚ MẬT KHẨU & TÙY CHỌN (Remember Me & Checkbox)
   ========================================================================== */

.form-check-input {
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.15rem;
    border-radius: 4px;
    border: 1.5px solid #cbd5e1;
    cursor: pointer;
    transition: all 0.15s ease;
}

.form-check-input:checked {
    background-color: #0098DA;
    border-color: #0098DA;
}

.form-check-label {
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    margin-left: 0.25rem;
}


/* ==========================================================================
   06. NÚT ĐĂNG NHẬP & HIỆU ỨNG TẢI (Submit Buttons & Loading)
   ========================================================================== */

.btn-login {
    background: linear-gradient(135deg, #0098DA 0%, #3DB6EB 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    font-size: 14.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(0, 152, 218, 0.32);
    cursor: pointer;
    letter-spacing: 0.3px;
}

.btn-login:hover {
    background: linear-gradient(135deg, #0088c4 0%, #2ba5db 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 152, 218, 0.45);
    color: #ffffff;
}

.btn-login:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 152, 218, 0.3);
}

.btn-login.loading {
    opacity: 0.8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


/* ==========================================================================
   07. THÔNG BÁO LỖI & PHẢN HỒI (Alert Badges & Errors)
   ========================================================================== */

.error {
    display: none;
    color: #ef4444;
    font-size: 12px;
    font-weight: 500;
    margin-top: 0.35rem;
}

#loginMessage,
#secondLoginMessage,
#loginAuthenticatorMessage {
    font-size: 13px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    margin-top: 0.75rem;
    margin-bottom: 0;
}

#loginMessage:empty,
#secondLoginMessage:empty,
#loginAuthenticatorMessage:empty {
    display: none;
}

#loginMessage.text-danger,
#secondLoginMessage.text-danger,
#loginAuthenticatorMessage.text-danger,
#loginAuthenticatorMessage.has-error {
    background-color: #fee2e2;
    color: #b91c1c !important;
    border: 1px solid #fca5a5;
}

#loginMessage.text-success,
#secondLoginMessage.text-success,
#loginAuthenticatorMessage.text-success,
#loginAuthenticatorMessage.has-success {
    background-color: #dcfce7;
    color: #15803d !important;
    border: 1px solid #86efac;
}

.input-wrapper .form-control.input-otp {
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    letter-spacing: normal;
}

.input-wrapper .form-control.input-otp:not(:placeholder-shown) {
    letter-spacing: 0.2rem;
}

.input-wrapper .form-control.input-otp::placeholder {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: normal;
}


/* ==========================================================================
   08. GIAO DIỆN XÁC THỰC CẤP 2 (Step 2 2FA Security Badge)
   ========================================================================== */

.step2-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.step2-icon-circle {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: #0098DA;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 152, 218, 0.18);
    margin: 0 auto 0.75rem;
}

.step2-title {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.step2-desc {
    font-size: 12.5px;
    color: #64748b;
    margin: 0;
}

.btn-back-login {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-back-login:hover {
    color: #0098DA;
    background-color: rgba(0, 152, 218, 0.08);
}


/* ==========================================================================
   09. CHÂN TRANG & BẢN QUYỀN (Footer Trust Badge & Copyright)
   ========================================================================== */

.login-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-top: 1.25rem;
}

.login-footer .footer-copyright {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}


/* ==========================================================================
   10. THIẾT KẾ ĐÁP ỨNG DI ĐỘNG (Mobile Responsive Breakpoints)
   ========================================================================== */

@media (max-width: 480px) {
    body {
        padding: 1rem 0.75rem;
    }

    .login-container {
        padding: 1.75rem 1.25rem;
        border-radius: 20px;
    }

    .login-brand-logo {
        max-width: 170px;
        max-height: 42px;
    }

    .btn-login {
        padding: 0.7rem 1rem;
        font-size: 14px;
    }

    .input-wrapper .form-control {
        font-size: 16px !important;
    }
}