/* ============================================================
   Theme "modern" — trang đăng nhập / đăng ký / quên mật khẩu / 2FA
   Chỉ là lớp giao diện, không đụng vào form hay JS của trang.
   ============================================================ */
:root {
    --auth-accent: #6d5ffa;
    --auth-accent-2: #6a4cf5;
    --auth-accent-soft: #eeecff;
    --auth-text: #1b2130;
    --auth-muted: #6b7488;
    --auth-border: #dcd7ff;
}

body:has(.auth-bg) {
    font-family: "Quicksand", "Plus Jakarta Sans", sans-serif;
    background: #f4f3fb;
    color: var(--auth-text);
}

/* Nền: gradient tím nhạt + 2 vệt sáng */
.auth-bg {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 18%, rgba(124, 107, 251, .22) 0, transparent 42%),
        radial-gradient(circle at 88% 82%, rgba(59, 130, 246, .16) 0, transparent 40%),
        linear-gradient(180deg, #f6f5ff 0%, #efedff 100%);
}

.auth-bg:before {
    display: none;
}

body:has(.auth-header-box) .auth-bg .mx-auto:after,
body:has(.auth-header-box) .auth-bg .mx-auto:before {
    display: none;
}

/* Thẻ form */
.auth-bg .card {
    border: 1px solid #e9e6fb;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 28px 70px rgba(31, 24, 90, .16);
    overflow: hidden;
}

.auth-bg .auth-header-box {
    border-radius: 0 !important;
    background: linear-gradient(135deg, #f1efff 0%, #fbfaff 100%);
    border-bottom: 1px solid #efeeff;
}

.auth-bg .auth-header-box > .text-center {
    padding: 26px 24px 20px !important;
}

.auth-bg .auth-logo {
    width: auto !important;
    max-width: 210px;
    max-height: 64px;
    height: auto !important;
    object-fit: contain;
}

.auth-bg .auth-header-box h4 {
    margin: 16px 0 0 !important;
    font-size: 20px !important;
    font-weight: 800;
    color: var(--auth-text);
}

.auth-bg .auth-header-box + .card-body {
    padding: 24px 28px 20px !important;
}

@media (min-width: 992px) {
    .auth-bg .col-lg-4 {
        flex: 0 0 auto;
        width: 100%;
        max-width: 470px;
    }
}

@media (max-width: 575.98px) {
    .auth-bg .auth-header-box + .card-body {
        padding: 20px 18px 16px !important;
    }
}

/* Nhãn + ô nhập */
.auth-bg .form-label {
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #384158;
}

.auth-bg .form-control {
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    background-color: #fff;
    background-repeat: no-repeat;
    background-position: 14px center;
    background-size: 18px;
    font-size: 14px;
    color: var(--auth-text);
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-bg .form-control::placeholder {
    color: #a3aabb;
}

.auth-bg .form-control:focus {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px var(--auth-accent-soft);
}

/* Icon trong ô nhập (thuần CSS, theo loại ô) */
.auth-bg input[type="password"].form-control,
.auth-bg input[type="email"].form-control,
.auth-bg input[name="email"].form-control,
.auth-bg input[name="username"].form-control,
.auth-bg input[name="phone"].form-control,
.auth-bg input[name="captcha_code"].form-control,
.auth-bg input[name="code"].form-control,
.auth-bg input[name="two_factor_code"].form-control {
    padding-left: 44px;
}

.auth-bg input[type="password"].form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa2b1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E");
}

.auth-bg input[type="email"].form-control,
.auth-bg input[name="email"].form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa2b1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3.5 7 8.5 6 8.5-6'/%3E%3C/svg%3E");
}

.auth-bg input[name="username"].form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa2b1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 3.6-7 8-7s8 3 8 7'/%3E%3C/svg%3E");
}

.auth-bg input[name="phone"].form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa2b1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 4h4l2 5-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2Z'/%3E%3C/svg%3E");
}

.auth-bg input[name="captcha_code"].form-control,
.auth-bg input[name="code"].form-control,
.auth-bg input[name="two_factor_code"].form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa2b1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 4 6v6c0 5 3.4 8 8 9 4.6-1 8-4 8-9V6l-8-3Z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
}

/* Nút */
.auth-bg .btn {
    border-radius: 12px;
    font-weight: 700;
}

.auth-bg .btn-primary {
    height: 46px;
    border: 0;
    background: linear-gradient(135deg, #7c6bfb 0%, var(--auth-accent-2) 100%);
    color: #fff;
    box-shadow: 0 8px 20px rgba(109, 95, 250, .32);
    transition: filter .15s ease, transform .1s ease;
}

.auth-bg .btn-primary:hover,
.auth-bg .btn-primary:focus {
    background: linear-gradient(135deg, #7c6bfb 0%, var(--auth-accent-2) 100%);
    filter: brightness(1.06);
    color: #fff;
}

.auth-bg .btn-primary:active {
    transform: translateY(1px);
}

.auth-bg .btn-primary:disabled,
.auth-bg .btn-primary.disabled {
    opacity: .65;
    box-shadow: none;
}

.auth-bg .btn-outline-danger {
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #e4e6ee;
    background: #fff;
    color: #384158;
}

.auth-bg .btn-outline-danger:hover,
.auth-bg .btn-outline-danger:focus {
    border-color: #f2b8c2;
    background: #fff5f7;
    color: #384158;
}

.auth-bg .btn-outline-danger .fa-google {
    color: #ea4335;
}

.auth-bg .btn-outline-secondary {
    border-color: var(--auth-border);
    color: var(--auth-accent);
    background: #fff;
}

.auth-bg .btn-outline-secondary:hover {
    background: var(--auth-accent-soft);
    border-color: var(--auth-accent);
    color: var(--auth-accent);
}

.auth-bg .btn-link {
    color: var(--auth-accent);
    font-weight: 600;
    text-decoration: none;
}

/* Liên kết, công tắc, captcha */
.auth-bg a.text-primary,
.auth-bg .text-primary {
    color: var(--auth-accent) !important;
    font-weight: 700;
    text-decoration: none;
}

.auth-bg a.text-muted:hover {
    color: var(--auth-accent) !important;
}

.auth-bg .form-check-input:checked {
    background-color: var(--auth-accent);
    border-color: var(--auth-accent);
}

.auth-bg .form-check-input:focus {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px var(--auth-accent-soft);
}

.auth-bg #captcha-img {
    border: 1px solid var(--auth-border);
    border-radius: 10px !important;
}

.auth-bg .dropdown-menu {
    border: 1px solid #e9e6fb;
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(31, 24, 90, .14);
    overflow: hidden;
}

.auth-bg .dropdown-item.active,
.auth-bg .dropdown-item:active {
    background: var(--auth-accent-soft);
    color: var(--auth-accent);
}

/* SweetAlert2 trên trang auth */
.swal2-popup {
    border-radius: 22px;
    font-family: "Quicksand", sans-serif;
}

.swal2-container.swal2-backdrop-show {
    background: rgba(24, 20, 56, .46) !important;
}

.swal2-popup .btn.btn-primary {
    padding: 10px 26px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #7c6bfb 0%, var(--auth-accent-2) 100%);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(109, 95, 250, .32);
}
