/* --- Base & Reset Styles --- */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body { background-color: #f4f7f9; color: #333; overflow-x: hidden; }

.page-container { transition: filter 0.3s ease; }
body.menu-open .page-container { filter: blur(5px); pointer-events: none; }

/* --- Header --- */
.header { background-color: #ffffff; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: center; position: sticky; top: 0; z-index: 100; }
.header-content { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 1400px; padding: 12px 20px; margin: 0 auto; }
.header-logo { color: #0d3880; font-size: 22px; font-weight: 700; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.header-logo i { font-size: 24px; color: #38bdf8; }
.header-right { display: flex; align-items: center; gap: 15px; }

/* User Menu Styles */
.user-nav { display: flex; align-items: center; gap: 15px; font-size: 14px; font-weight: 600; }
.user-nav a { text-decoration: none; color: #4b5563; transition: color 0.2s; }
.user-nav a:hover { color: #38bdf8; }
.btn-register { background-color: #38bdf8; color: #fff !important; padding: 8px 16px; border-radius: 6px; }
.btn-register:hover { background-color: #0ea5e9; }
.btn-logout { color: #dc3545 !important; }
.user-greet { color: #0d3880; background: #e0f2fe; padding: 5px 10px; border-radius: 20px; }

.header-btn { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 6px; border: 1px solid #ccc; background-color: #fff; color: #666; font-size: 18px; cursor: pointer; }
.btn-blue { background-color: #38bdf8; color: #fff; border: none; }

/* --- Sub-Header (Stepper) --- */
.sub-header-stepper { background-color: #ffffff; border-bottom: 1px solid #e5e7eb; display: flex; width: 100%; }
.stepper-content { display: flex; justify-content: flex-start; align-items: center; width: 100%; max-width: 1400px; padding: 15px 20px; margin: 0 auto; overflow-x: auto; white-space: nowrap; }
@media (min-width: 768px) { .stepper-content { justify-content: center; } }
.stepper-content::-webkit-scrollbar { display: none; }
.stepper-content { -ms-overflow-style: none; scrollbar-width: none; }

.step { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #9ca3af; flex-shrink: 0; }
.step.active { color: #111827; }
.step-num { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background-color: #9ca3af; color: #ffffff; font-size: 13px; font-weight: 700; flex-shrink: 0; line-height: 1; }
.step.active .step-num { background-color: #38bdf8; }
.step-divider { width: 50px; height: 2px; background-color: #d1d5db; margin: 0 12px; position: relative; flex-shrink: 0; }
.step-divider::after { content: ""; position: absolute; right: 0; top: -4px; width: 8px; height: 8px; border-top: 2px solid #d1d5db; border-right: 2px solid #d1d5db; transform: rotate(45deg); }

/* --- Main Content Layout --- */
.main-content { padding: 20px 20px; display: grid; grid-template-columns: 1fr; gap: 30px; max-width: 1400px; margin: 0 auto; }
@media (min-width: 1024px) { .main-content { grid-template-columns: 3fr 1.2fr; padding: 40px 20px; } }

/* --- Left Side: Form & Cards --- */
.content-left h1 { font-size: 20px; font-weight: 500; color: #111827; margin-bottom: 15px; }

/* Box nhập Form URL */
.form-box { background: #fff; border: 1.5px solid #38bdf8; border-radius: 10px; padding: 20px; margin-bottom: 25px; box-shadow: 0 4px 15px rgba(56, 189, 248, 0.15); }
.form-box h3 { font-size: 16px; margin-bottom: 12px; color: #0d3880; }
.input-group { display: flex; gap: 10px; }
.input-group input { flex-grow: 1; padding: 12px 15px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 15px; outline: none; transition: 0.2s; }
.input-group input:focus { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2); }
.input-group button { background: #38bdf8; color: #fff; border: none; padding: 0 25px; border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.2s; white-space: nowrap; }
.input-group button:hover { background: #0ea5e9; }

/* Box Kết quả tạo QR thành công */
.success-box { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 20px; margin-bottom: 25px; }
.success-box h3 { color: #166534; margin-bottom: 10px; font-size: 18px; }
.success-box a.link { color: #2563eb; font-weight: bold; text-decoration: underline; word-break: break-all; }
.action-btns { display: flex; gap: 10px; margin-top: 15px; flex-wrap: wrap;}
.btn-action { padding: 10px 20px; border-radius: 6px; text-decoration: none; font-weight: bold; font-size: 14px; text-align: center; }
.btn-stats { background: #fff; border: 1px solid #d1d5db; color: #374151; }
.btn-stats:hover { background: #f3f4f6; }
.btn-download { background: #10b981; color: #fff; }
.btn-download:hover { background: #059669; }

.cards-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.qr-card { background-color: #ffffff; border: 1px solid #f0f0f0; border-radius: 8px; padding: 12px 15px; display: flex; align-items: center; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); transition: all 0.2s; }
.qr-card:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05); border-color: #38bdf8; }
.qr-card.active { border: 1.5px solid #38bdf8; }
.qr-card-icon-box { width: 45px; height: 45px; background-color: #e0f2fe; color: #38bdf8; border-radius: 8px; display: flex; justify-content: center; align-items: center; font-size: 22px; flex-shrink: 0; }
.qr-card-text { flex-grow: 1; margin-left: 15px; text-align: left; }
.qr-card-title { font-size: 15px; font-weight: 700; color: #111827; display: block; }
.qr-card-desc { font-size: 12px; color: #6b7280; margin-top: 3px; display: block; }
.qr-card-arrow { color: #111827; font-size: 16px; }

@media (min-width: 768px) { 
    .cards-grid { grid-template-columns: repeat(3, 1fr); gap: 20px;}
    .qr-card { flex-direction: column; text-align: center; padding: 25px 15px; }
    .qr-card-icon-box { background-color: transparent; margin-bottom: 10px; font-size: 35px; width: auto; height: auto; }
    .qr-card-text { margin-left: 0; text-align: center; }
    .qr-card-title { font-size: 16px; margin-bottom: 5px; }
    .qr-card-arrow { display: none; }
}
@media (min-width: 1024px) { .cards-grid { grid-template-columns: repeat(4, 1fr); } }

/* --- Right Side: Preview Phone --- */
.content-right { display: none; }
@media (min-width: 1024px) {
    .content-right { display: flex; flex-direction: column; align-items: center; position: sticky; top: 150px; height: max-content; }
}
.preview-phone-container { width: 300px; position: relative; }
.preview-phone-img { width: 100%; height: auto; display: block; }

.preview-qr-wrapper {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); 
    width: 75%; height: 75%; display: flex; justify-content: center; align-items: center; border-radius: 20px; 
    background: #fff; box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.preview-qr-img { width: 100%; height: auto; display: block; border-radius: 10px;}
.preview-text { font-size: 18px; font-weight: 600; margin-top: 20px; text-align: center; }

/* --- Sidebar Menu --- */
.sidebar { position: fixed; top: 0; left: 0; width: 260px; height: 100vh; background-color: #ffffff; border-right: 1px solid #e5e7eb; z-index: 200; transform: translateX(-100%); transition: transform 0.3s ease; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; }
body.menu-open .sidebar { transform: translateX(0); }
.sidebar-header { display: flex; align-items: center; gap: 8px; margin-bottom: 30px; }
.sidebar-logo-icon { color: #38bdf8; font-size: 24px; }
.sidebar-logo-text { color: #0d3880; font-size: 20px; font-weight: 700; }
.sidebar-menu-list { list-style: none; display: flex; flex-direction: column; gap: 5px; flex-grow: 1; }
.sidebar-menu-item a { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #4b5563; font-size: 15px; font-weight: 500; padding: 12px; border-radius: 8px; transition: 0.2s; }
.sidebar-menu-item.active a, .sidebar-menu-item a:hover { background-color: #f0f9ff; color: #0d3880; font-weight: 600; }
.sidebar-menu-item a i { font-size: 18px; width: 20px; text-align: center; color: #9ca3af;}
.sidebar-menu-item.active a i { color: #38bdf8;}

.menu-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-color: rgba(0, 0, 0, 0.5); z-index: 150; display: none; cursor: pointer; }
body.menu-open .menu-overlay { display: block; }

/* ========================================================
   GIAO DIỆN AUTH (ĐĂNG NHẬP / ĐĂNG KÝ)
======================================================== */
.auth-container {
    display: flex;
    min-height: 100vh;
    background-color: #f4f7f9; /* Nền cho mobile */
}

/* Nửa trái chứa form */
.auth-left {
    flex: 1;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 20px;
}

.auth-logo-wrapper {
    position: absolute;
    top: 30px;
    left: 40px;
}

.auth-box {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.auth-title {
    font-size: 28px;
    font-weight: 800;
    color: #111827;
    text-align: center;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    margin-bottom: 30px;
}

/* Nút Google */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-google:hover { background: #f9fafb; }
.btn-google img { width: 18px; height: 18px; }

/* Đường gạch ngang "Hoặc" */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 25px 0;
    color: #6b7280;
    font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}
.auth-divider::before { margin-right: 15px; }
.auth-divider::after { margin-left: 15px; }

/* Các ô Input */
.auth-input-group {
    position: relative;
    margin-bottom: 18px;
}
.auth-input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 14px;
}
.auth-input-action {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 14px;
    cursor: pointer;
}
.auth-input {
    width: 100%;
    padding: 14px 15px 14px 42px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: 0.2s;
}
.auth-input:focus { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56,189,248,0.1); }

/* Nút Submit Xanh */
.btn-auth-submit {
    width: 100%;
    padding: 14px;
    background-color: #0ea5e9;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    margin-top: 5px;
}
.btn-auth-submit:hover { background-color: #0284c7; }

/* Switch & Terms */
.auth-switch { text-align: center; margin-top: 25px; font-size: 14px; color: #6b7280; }
.auth-switch a { color: #0ea5e9; font-weight: 700; text-decoration: none; }
.auth-terms { text-align: center; margin-top: 40px; font-size: 12px; color: #9ca3af; line-height: 1.5; }
.auth-terms a { color: #6b7280; text-decoration: underline; }

/* Nửa phải (Chỉ hiện trên Desktop) */
.auth-right {
    flex: 1;
    background-color: #0ea5e9; /* Màu nền xanh */
    display: none; /* Mặc định ẩn trên mobile */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    padding: 40px;
    text-align: center;
}

@media (min-width: 1024px) {
    .auth-right {
        display: flex; /* Hiện trên màn hình PC */
    }
}

.auth-right-img { max-width: 80%; height: auto; margin-bottom: 30px; }
.auth-right h2 { font-size: 24px; font-weight: 700; margin-bottom: 15px; }
.auth-right p { font-size: 15px; color: #e0f2fe; max-width: 400px; line-height: 1.6; }

/* Giao diện Mobile/Tablet đặc thù */
@media (max-width: 1023px) {
    .auth-left {
        background-color: transparent;
        justify-content: flex-start;
        padding-top: 80px;
    }
    .auth-logo-wrapper {
        top: 20px;
        left: 20px;
    }
    .auth-box {
        background: #fff;
        padding: 40px 30px;
        border-radius: 12px;
        box-shadow: 0 10px 25px rgba(0,0,0,0.05);
        margin-top: 20px;
    }
}
