/* ==========================================================================
   CHỢ THUÊ TẤT — TRANG ĐĂNG NHẬP HIỆN ĐẠI (CHÍNH XÁC THEO MOCKUP THIẾT KẾ)
   ========================================================================== */

:root {
    --auth-primary: #1677ff;
    --auth-primary-hover: #0958d9;
    --auth-primary-soft: #f0f7ff;
    --auth-text-title: #0e3066;
    --auth-text-body: #1e293b;
    --auth-text-muted: #64748b;
    --auth-border: #e2e8f0;
    --auth-border-focus: #1677ff;
    --auth-radius-card: 28px;
    --auth-radius-input: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.auth-body-page {
    min-height: 100vh;
    background: linear-gradient(180deg, #d4e8fc 0%, #e6f1fc 35%, #f4f9fd 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--auth-text-body);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 16px;
    position: relative;
    overflow-x: hidden;
}

/* Nền hình silhouette thành phố & mây phía xa */
.auth-bg-decor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 380px;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
    opacity: 0.85;
}

.auth-skyline-svg {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    min-width: 1200px;
    width: 100%;
    height: 280px;
}

/* Header thương hiệu nhỏ bên trên Card */
.auth-top-brand {
    position: relative;
    z-index: 10;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
    transition: transform 0.2s ease;
}

.auth-top-brand:hover {
    transform: scale(1.03);
}

.auth-top-brand-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.auth-top-brand-text {
    display: flex;
    flex-direction: column;
}

.auth-top-brand-name {
    font-size: 20px;
    font-weight: 800;
    color: #0c4383;
    line-height: 1.2;
    letter-spacing: 0.5px;
}

.auth-top-brand-slogan {
    font-size: 11px;
    color: #4b6b94;
    font-weight: 600;
}

/* ==========================================================================
   CARD ĐĂNG NHẬP CHÍNH
   ========================================================================== */
.auth-card-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 500px;
    background: #ffffff;
    border-radius: var(--auth-radius-card);
    box-shadow: 0 20px 60px rgba(13, 99, 187, 0.12), 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
}

/* Hình minh họa góc trên bên phải (House & Movers) */
.auth-hero-graphic {
    position: absolute;
    top: -55px;
    right: 5px;
    width: 235px;
    z-index: 12;
    pointer-events: none;
    filter: drop-shadow(0 10px 20px rgba(12, 74, 142, 0.15));
}

.auth-hero-graphic img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    border-radius: 16px;
}

/* Nội dung bên trong Card */
.auth-card-body {
    padding: 36px 36px 26px;
    position: relative;
    z-index: 5;
}

/* Tiêu đề & Lời chào */
.auth-header-group {
    margin-bottom: 24px;
    text-align: center;
    /* max-width: 290px; */
    /* Dành khoảng trống góc trên phải cho hình minh họa */
}

.auth-title {
    font-size: 26px;
    font-weight: 850;
    color: var(--auth-text-title);
    margin: 0 0 8px;
    line-height: 1.2;
    letter-spacing: -0.3px;
}

.auth-welcome {
    font-size: 15px;
    font-weight: 700;
    color: #1a3c70;
    margin: 0 0 6px;
    line-height: 1.35;
}

.auth-lead {
    font-size: 13px;
    color: var(--auth-text-muted);
    margin: 0;
    line-height: 1.45;
}

/* Flash Messages Alert */
.auth-alert-box {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

.auth-alert-error {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.auth-alert-success {
    background-color: #dcfce7;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

/* Các trường nhập liệu (Inputs) */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-input-group {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius-input);
    padding: 0 14px;
    height: 50px;
    transition: all 0.2s ease;
}

.auth-input-group:focus-within {
    border-color: var(--auth-border-focus);
    background: #ffffff;
    box-shadow: 0 0 0 3.5px rgba(22, 119, 255, 0.12);
}

.auth-input-group.has-error {
    border-color: #ef4444;
    background: #fffbfa;
}

.auth-input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    margin-right: 10px;
    flex-shrink: 0;
}

.auth-input-field {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--auth-text-body);
    width: 100%;
}

.auth-input-field::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.auth-toggle-pwd {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
    flex-shrink: 0;
}

.auth-toggle-pwd:hover {
    color: var(--auth-text-body);
}

.auth-field-error {
    font-size: 12px;
    color: #ef4444;
    margin-top: 4px;
    margin-left: 4px;
    display: block;
}

/* Hàng Nhớ tài khoản & Quên mật khẩu */
.auth-options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2px 0 6px;
    font-size: 13.5px;
}

.auth-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.auth-checkbox-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    border: 1.5px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--auth-primary);
}

.auth-forgot-link {
    color: #0284c7;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease;
}

.auth-forgot-link:hover {
    color: #0369a1;
    text-decoration: underline;
}

/* Nút Đăng nhập chính */
.btn-auth-submit {
    width: 100%;
    height: 48px;
    background: var(--auth-primary);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: var(--auth-radius-input);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(22, 119, 255, 0.35);
    transition: all 0.22s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-auth-submit:hover {
    background: var(--auth-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(22, 119, 255, 0.45);
}

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

/* Hoặc đăng nhập bằng (Divider) */
.auth-divider {
    margin: 20px 0 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--auth-text-muted);
    font-size: 13px;
    font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: #e2e8f0;
}

/* 2 Nút mạng xã hội (Google & Facebook) */
.auth-social-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.btn-social-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 46px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--auth-radius-input);
    text-decoration: none !important;
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-social-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    color: #0f172a;
}

.social-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ==========================================================================
   KHUNG CHƯA CÓ TÀI KHOẢN (SIGNUP PROMPT BOX)
   ========================================================================= */
.auth-register-box {
    margin-top: 22px;
    background: var(--auth-primary-soft);
    border: 1.5px solid #d0e7ff;
    border-radius: 16px;
    padding: 16px 18px;
}

.reg-box-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.reg-avatar-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1677ff 0%, #0d66e5 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(22, 119, 255, 0.25);
}

.reg-text-group {
    display: flex;
    flex-direction: column;
}

.reg-title {
    font-size: 14.5px;
    font-weight: 800;
    color: var(--auth-text-title);
    margin-bottom: 2px;
}

.reg-subtitle {
    font-size: 12.5px;
    color: #475569;
    line-height: 1.35;
}

.btn-auth-outline {
    display: block;
    width: 100%;
    padding: 10px;
    text-align: center;
    background: #ffffff;
    border: 1.5px solid var(--auth-primary);
    border-radius: 10px;
    color: var(--auth-primary);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.btn-auth-outline:hover {
    background: var(--auth-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(22, 119, 255, 0.25);
}

/* ==========================================================================
   FOOTER CHÂN CARD (BOTTOM BANNER / COMMITMENT)
   ========================================================================= */
.auth-card-footer {
    background: linear-gradient(180deg, #f8fcff 0%, #ebf5fe 100%);
    border-top: 1px solid #e1effd;
    border-radius: 0 0 var(--auth-radius-card) var(--auth-radius-card);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.footer-commit-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-shield-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--auth-primary);
}

.footer-commit-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.commit-headline {
    font-size: 13px;
    font-weight: 750;
    color: var(--auth-text-title);
    line-height: 1.25;
}

.commit-subline {
    font-size: 11.5px;
    color: var(--auth-text-muted);
    line-height: 1.3;
}

.footer-phone-graphic {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
}

.footer-phone-graphic img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Quay về trang chủ */
.auth-back-home {
    margin-top: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #475569;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}

.auth-back-home:hover {
    color: var(--auth-primary);
}

/* ==========================================================================
   TRANG ĐĂNG KÝ TÀI KHOẢN (REGISTER STYLES)
   ========================================================================= */
.auth-card-register {
    max-width: 530px;
}

.auth-register-header-group {
    margin-bottom: 20px;
}

/* Nhóm chọn đối tượng */
.auth-roles-section {
    margin-bottom: 20px;
}

.roles-headline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 800;
    color: var(--auth-text-title);
    margin-bottom: 12px;
}

.roles-headline svg {
    color: var(--auth-primary);
    flex-shrink: 0;
}

.roles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.role-card {
    background: #ffffff;
    border: 1.5px solid var(--auth-border);
    border-radius: 14px;
    padding: 14px 10px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.role-card:hover {
    border-color: #93c5fd;
    background: #fafcff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(13, 99, 187, 0.08);
}

.role-card.is-selected {
    border: 2px solid var(--auth-primary);
    background: #fbfdff;
    box-shadow: 0 4px 16px rgba(22, 119, 255, 0.15);
}

.role-check-mark {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--auth-primary);
    color: #ffffff;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
    box-shadow: 0 2px 6px rgba(22, 119, 255, 0.35);
}

.role-card.is-selected .role-check-mark {
    display: flex;
}

.role-icon-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #eaf3fe;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.role-name {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--auth-text-title);
    margin: 0 0 4px;
    line-height: 1.25;
}

.role-desc {
    font-size: 11px;
    color: var(--auth-text-muted);
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Trường nhập liệu 2 tầng (Stacked Labels) */
.auth-input-stacked {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius-input);
    padding: 7px 14px;
    min-height: 56px;
    transition: all 0.2s ease;
}

.auth-input-stacked:focus-within {
    border-color: var(--auth-border-focus);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

.auth-input-stacked.has-error {
    border-color: #ef4444;
    background: #fffbfa;
}

.auth-input-stacked-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.auth-label-stacked {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    line-height: 1.2;
    margin-bottom: 2px;
    cursor: pointer;
}

.auth-label-stacked .req-star {
    color: #ef4444;
    margin-left: 2px;
}

.auth-input-stacked .auth-input-field {
    font-size: 13.5px;
    height: 22px;
}

.auth-input-stacked .auth-input-field::placeholder {
    font-size: 13px;
    color: #94a3b8;
}

/* Link đã có tài khoản */
.auth-has-account {
    text-align: center;
    font-size: 13.5px;
    color: var(--auth-text-muted);
    margin-top: 16px;
}

.auth-has-account a {
    color: var(--auth-primary);
    font-weight: 700;
    text-decoration: none;
}

.auth-has-account a:hover {
    text-decoration: underline;
}

/* Footer Handshake Graphic */
.footer-handshake-wrap {
    width: 82px;
    height: 70px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-handshake-wrap svg {
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================================================= */
@media (max-width: 540px) {
    body.auth-body-page {
        padding: 24px 12px;
    }

    .auth-card-body {
        padding: 28px 18px 20px;
    }

    .auth-title {
        font-size: 22px;
    }

    .auth-hero-graphic {
        width: 160px;
        top: -40px;
        right: 0px;
    }

    .auth-header-group {
        max-width: 220px;
    }

    .roles-grid {
        gap: 8px;
    }

    .role-card {
        padding: 10px 6px;
    }

    .role-icon-circle {
        width: 48px;
        height: 48px;
    }

    .role-icon-circle svg {
        width: 32px;
        height: 32px;
    }

    .role-name {
        font-size: 12.5px;
    }

    .role-desc {
        font-size: 10.5px;
    }

    .auth-card-footer {
        padding: 12px 16px;
    }

    .commit-headline {
        font-size: 12px;
    }

    .commit-subline {
        font-size: 11px;
    }

    .footer-phone-graphic,
    .footer-handshake-wrap {
        width: 58px;
        height: 58px;
    }
}

@media (max-width: 380px) {
    .auth-hero-graphic {
        width: 130px;
        top: -30px;
    }

    .auth-title {
        font-size: 20px;
    }

    .auth-social-grid {
        grid-template-columns: 1fr;
    }

    .roles-grid {
        grid-template-columns: 1fr;
    }
}