﻿/* ==========================================================================
   MODULE: LOGIN PAGE STYLESHEET - GPSTRACKING WEB APPLICATION
   --------------------------------------------------------------------------
   01. BIẾN MÀU & ĐỊNH NGHĨA CHUNG (CSS Variables & Resets)
   02. BỐ CỤC KHUNG CHÍNH (Layout Containers)
   03. THẺ ĐĂNG NHẬP (Auth Card & Brand Elements)
   04. BIỂU MẪU NHẬP LIỆU (Form Controls & Input Groups)
   05. TRẠNG THÁI & THÔNG BÁO (Alerts & Validation Messages)
   06. MÃ QR & LIÊN KẾT MẠNG XÃ HỘI (QR Codes & Social Links)
   07. CỘT ẢNH NỀN (Hero Visual Background)
   08. THIẾT KẾ ĐÁP ỨNG (Media Queries)
   ========================================================================== */

/* --------------------------------------------------------------------------
   01. BIẾN MÀU & ĐỊNH NGHĨA CHUNG
   -------------------------------------------------------------------------- */
:root {
    --auth-color-primary: #0098da;
    --auth-color-primary-hover: #0086c2;
    --auth-color-gradient: linear-gradient(135deg, #0098da 0%, #20b6f7 100%);
    --auth-color-text-dark: #0f172a;
    --auth-color-text-muted: #475569;
    --auth-color-text-light: #64748b;
    --auth-color-border: #cbd5e1;
    --auth-color-border-focus: #0098da;
    --auth-color-danger-bg: #fee2e2;
    --auth-color-danger-text: #b91c1c;
    --auth-color-danger-border: #fca5a5;
    --auth-color-success-bg: #dcfce7;
    --auth-color-success-text: #15803d;
    --auth-radius-sm: 0.4rem;
    --auth-radius-md: 0.8rem;
    --auth-radius-lg: 1.2rem;
    --auth-radius-xl: 1.6rem;
    --auth-shadow-card: 0 10px 30px rgba(0, 0, 0, 0.08);
    --auth-shadow-btn: 0 4px 14px rgba(0, 152, 218, 0.28);
}

.auth-page {
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #f8fafc;
    color: var(--auth-color-text-dark);
}

/* --------------------------------------------------------------------------
   02. BỐ CỤC KHUNG CHÍNH
   -------------------------------------------------------------------------- */
.auth-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background-color: #ffffff;
}

.auth-container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100vh;
    padding: 2.5rem 3.5rem;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: #ffffff;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.05);
}

.auth-container::-webkit-scrollbar {
    width: 6px;
}

.auth-container::-webkit-scrollbar-thumb {
    background-color: var(--auth-color-border);
    border-radius: 4px;
}

.auth-content {
    width: 100%;
    max-width: 44rem;
    margin: 0 auto;
    padding: 1rem 0;
}

/* --------------------------------------------------------------------------
   03. THẺ ĐĂNG NHẬP & LOGO
   -------------------------------------------------------------------------- */
.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-brand__logo {
    width: 100%;
    max-width: 21rem;
    height: auto;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.06));
    transition: transform 0.3s ease;
}

.auth-brand__logo:hover {
    transform: scale(1.02);
}

.auth-brand__title {
    margin-top: 1rem;
    margin-bottom: 0;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--auth-color-primary);
}

.auth-header-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    padding-bottom: 0.6rem;
    margin-bottom: 1.8rem;
    border-bottom: 3px solid var(--auth-color-primary);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--auth-color-primary);
}

/* --------------------------------------------------------------------------
   04. BIỂU MẪU NHẬP LIỆU
   -------------------------------------------------------------------------- */
.auth-form__group {
    margin-bottom: 1.4rem;
}

.auth-form__label {
    display: block;
    margin-bottom: 0.6rem;
    text-align: left;
    font-size: 1.35rem;
    font-weight: 600;
    color: #334155;
}

.auth-form__input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.auth-form__icon {
    position: absolute;
    left: 1.4rem;
    z-index: 3;
    font-size: 1.5rem;
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.2s ease;
}

.auth-form__input {
    width: 100%;
    height: 4.4rem;
    padding: 0.6rem 4.2rem;
    border: 1.5px solid var(--auth-color-border);
    border-radius: var(--auth-radius-md);
    background-color: #ffffff;
    font-size: 1.4rem;
    color: var(--auth-color-text-dark);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-form__input:focus {
    border-color: var(--auth-color-border-focus);
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 152, 218, 0.16);
}

.auth-form__input-wrapper:focus-within .auth-form__icon {
    color: var(--auth-color-primary);
}

.auth-form__toggle-password {
    position: absolute;
    right: 1.2rem;
    z-index: 4;
    padding: 0.4rem;
    border: none;
    border-radius: var(--auth-radius-sm);
    background: transparent;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s ease;
}

.auth-form__toggle-password:hover {
    color: var(--auth-color-primary);
}

.auth-form__checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 1rem;
    margin-bottom: 1.6rem;
    user-select: none;
}

.auth-form__checkbox {
    width: 1.8rem;
    height: 1.8rem;
    accent-color: var(--auth-color-primary);
    cursor: pointer;
}

.auth-form__checkbox-label {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--auth-color-text-muted);
    cursor: pointer;
}

.auth-form__btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    width: 100%;
    height: 4.4rem;
    padding: 0.6rem 2rem;
    border: none;
    border-radius: var(--auth-radius-md);
    background: var(--auth-color-gradient);
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    box-shadow: var(--auth-shadow-btn);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-form__btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 152, 218, 0.38);
}

.auth-form__btn-submit:disabled {
    opacity: 0.75;
    cursor: not-allowed;
    transform: none;
}

/* --------------------------------------------------------------------------
   05. TRẠNG THÁI & THÔNG BÁO
   -------------------------------------------------------------------------- */
.auth-alert {
    display: none;
    margin-top: 1rem;
    padding: 0.8rem 1.2rem;
    border-radius: var(--auth-radius-sm);
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    word-break: break-word;
}

.auth-alert.is-visible {
    display: block;
}

.auth-alert.has-error {
    border: 1px solid var(--auth-color-danger-border);
    background-color: var(--auth-color-danger-bg);
    color: var(--auth-color-danger-text);
}

.auth-alert.has-success {
    border: 1px solid #86efac;
    background-color: var(--auth-color-success-bg);
    color: var(--auth-color-success-text);
}

/* Xác thực cấp 2 & Bước 3 (Google Authenticator) */
.auth-step2,
.auth-step3 {
    animation: authFadeIn 0.3s ease-out forwards;
}

.auth-step-desc {
    margin: 0 0 1.4rem;
    font-size: 1.35rem;
    line-height: 1.5;
    color: var(--auth-color-text-muted);
}

.auth-form__input--otp {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: left;
    letter-spacing: normal;
}

.auth-form__input--otp:not(:placeholder-shown) {
    letter-spacing: 0.25rem;
}

.auth-form__input--otp::placeholder {
    font-size: 1.35rem;
    font-weight: 400;
    letter-spacing: normal;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-step2__back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.8rem;
    border-radius: 0.6rem;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--auth-color-text-muted);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.auth-step2__back-link:hover {
    background-color: #f0f9ff;
    color: var(--auth-color-primary);
}

/* --------------------------------------------------------------------------
   06. MÃ QR & LIÊN KẾT MẠNG XÃ HỘI
   -------------------------------------------------------------------------- */
.auth-qr {
    padding: 1.4rem 1.6rem;
    margin: 1.8rem 0 1.2rem;
    border: 1px solid #e2e8f0;
    border-radius: var(--auth-radius-lg);
    background-color: #f8fafc;
    text-align: center;
}

.auth-qr__title {
    margin: 0 0 0.8rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #334155;
}

.auth-qr__grid {
    display: flex;
    justify-content: center;
    gap: 1.8rem;
}

.auth-qr__item {
    flex: 1;
    max-width: 11rem;
    padding: 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.auth-qr__img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0.6rem;
}

.auth-qr__label {
    padding: 0.25rem 0.6rem;
    margin-top: 0.6rem;
    margin-bottom: 0;
    border: 1px solid #bae6fd;
    border-radius: 1rem;
    background-color: #f0f9ff;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--auth-color-primary);
}

.auth-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    margin: 1.2rem 0 0.8rem;
}

.auth-social__link {
    display: inline-flex;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease;
}

.auth-social__link:hover {
    transform: translateY(-3px) scale(1.08);
}

.auth-social__icon {
    display: block;
    width: 4.4rem;
    height: 4.4rem;
    border-radius: 1rem;
    object-fit: cover;
}

.auth-footer {
    margin-top: 1rem;
    margin-bottom: 0;
    font-size: 1.25rem;
    font-weight: 500;
    text-align: center;
    color: var(--auth-color-text-light);
}

/* --------------------------------------------------------------------------
   07. CỘT ẢNH NỀN
   -------------------------------------------------------------------------- */
.auth-hero {
    position: relative;
    height: 100vh;
    overflow: hidden;
    background-color: #0f172a;
}

.auth-hero__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(circle at 20% 25%, rgba(0, 152, 218, 0.4) 0%, transparent 55%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.72) 0%, rgba(10, 37, 64, 0.55) 50%, rgba(15, 23, 42, 0.85) 100%);
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   08. THIẾT KẾ ĐÁP ỨNG (MEDIA QUERIES)
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
    .auth-hero {
        display: none;
    }

    .auth-wrapper {
        background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    }

    .auth-container {
        align-items: center;
        width: 100%;
        background-color: transparent;
        box-shadow: none;
    }

    .auth-content {
        padding: 2.5rem;
        border: 1px solid #e2e8f0;
        border-radius: var(--auth-radius-xl);
        background-color: #ffffff;
        box-shadow: var(--auth-shadow-card);
    }
}

@media (max-width: 575.98px) {
    .auth-container {
        padding: 1.5rem 1rem;
    }

    .auth-content {
        padding: 2rem 1.5rem;
        border-radius: var(--auth-radius-lg);
        box-shadow: none;
    }

    .auth-qr__grid {
        gap: 1rem;
    }

    .auth-social__icon {
        width: 4rem;
        height: 4rem;
    }
}
