:root {
    /* Color Palette - Modern SaaS Style */
    --primary: #1a56db;
    --primary-hover: #1e429f;
    --bg-main: #f9fafb;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --white: #ffffff;
    --error: #ef4444;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Typography */
    --font-family: "Plus Jakarta Sans", sans-serif;
}

* {
    box-sizing: border-box;
}

body.vwd-auth-page {
    margin: 0;
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.vwd-auth-wrapper {
    width: 100%;
    padding: 24px;
}

.vwd-auth-container {
    max-width: 440px;
    margin: 0 auto;
}

.vwd-auth-logo {
    text-align: center; /* Căn giữa logo */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Thẻ A bọc ảnh (để hiệu ứng hover mượt hơn) */
.vwd-auth-logo a {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
}

/* Hiệu ứng phóng nhẹ khi di chuột vào Logo */
.vwd-auth-logo a:hover {
    transform: scale(1.05);
}

/* Định dạng ảnh Logo chính */
.vwd-auth-logo img {
    /* Vì ảnh là hình vuông 500x500 nhưng chứa logo nằm ngang, 
       chúng ta nên tăng chiều rộng lên để nhìn rõ nội dung */
    width: 120px; /* Tăng chiều rộng hiển thị */
    height: auto; /* Để chiều cao tự nhảy theo tỉ lệ 1:1 (cũng sẽ là 120px) */

    /* Căn chỉnh lại khoảng cách */
    margin-top: -20px; /* Đẩy lên một chút nếu ảnh có viền trắng thừa bên trên */
    margin-bottom: -10px; /* Giảm bớt khoảng trống thừa bên dưới */

    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.05));
    transition: transform 0.3s ease;
}

.vwd-auth-logo a:hover img {
    transform: scale(1.08); /* Hiệu ứng phóng to nhẹ khi hover */
}

.vwd-auth-card {
    background: var(--white);
    padding: 40px;
    border-radius: 20px; /* Bo góc mạnh hơn cho hiện đại */
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.vwd-auth-header p {
    font-size: 20px;
    color: #282828a6;
    text-align: center;
    line-height: 1.5;
    font-weight: 700;
}

/* Alert Styling */
.vwd-alert {
    padding: 14px 18px;
    background-color: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: 10px;
    color: var(--error);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.vwd-alert i {
    font-size: 16px;
}

/* Form Styling */
.vwd-input-group {
    margin-bottom: 24px;
}

.vwd-input-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.vwd-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

/* Icon bên trái Input */
.vwd-input-wrapper i.input-icon {
    position: absolute;
    left: 16px; /* Khoảng cách từ mép trái box vào icon */
    color: var(--text-muted);
    font-size: 16px;
    z-index: 2; /* Đảm bảo icon luôn nằm trên */
    pointer-events: none; /* Click xuyên qua icon vào input */
}

.vwd-input-wrapper input {
    width: 100%;
    /* QUAN TRỌNG: 46px để không đè lên icon 16px + 16px lề */
    padding: 13px 16px 13px 46px !important;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.25s ease;
    position: relative;
    z-index: 1;
}

.vwd-input-wrapper input::placeholder {
    color: #9ca3af;
}

.vwd-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(26, 86, 219, 0.1);
    background-color: #fff;
}

/* Nút hiện ẩn mật khẩu */
.vwd-toggle-password {
    position: absolute;
    right: 12px;
    z-index: 3;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 8px;
}

.vwd-toggle-password:hover {
    color: var(--primary);
}

.vwd-input-wrapper input[type="password"],
.vwd-input-wrapper input[type="text"] {
    padding-right: 45px;
}

/* Extras: Remember & Forgot */
.vwd-form-extras {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    font-size: 14px;
}

.vwd-remember {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

.vwd-remember input {
    width: 16px;
    height: 16px;
    margin-right: 10px;
    accent-color: var(--primary);
    cursor: pointer;
}

.vwd-forgot-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.vwd-forgot-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Submit Button */
.vwd-btn-submit {
    width: 100%;
    padding: 14px;
    background-color: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 6px -1px rgba(26, 86, 219, 0.2);
}

.vwd-btn-submit:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(26, 86, 219, 0.25);
}

.vwd-btn-submit:active {
    transform: translateY(0);
}

.vwd-btn-submit i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.vwd-btn-submit:hover i {
    transform: translateX(4px);
}

/* Footer & Back Home */
.vwd-auth-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border); /* Đường kẻ mảnh ngăn cách */
}

.vwd-auth-footer p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

.vwd-auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    margin-left: 5px;
}

.vwd-auth-footer a:hover {
    text-decoration: underline;
}

.vwd-back-to-home {
    text-align: center;
    margin-top: 28px;
}

.vwd-back-to-home a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.vwd-back-to-home a:hover {
    color: var(--text-main);
}

/* ====================== CSS REGSITER =============================*/
:root {
    --vwd-primary: #1a56db;
    --vwd-primary-hover: #1e429f;
    --vwd-bg: #f9fafb;
    --vwd-text: #111827;
    --vwd-text-light: #6b7280;
    --vwd-border: #e5e7eb;
}

.vwd-aff-body {
    margin: 0;
    padding: 0;
    font-family: "Plus Jakarta Sans", sans-serif;
    background-color: var(--vwd-bg);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.vwd-aff-container {
    width: 100%;
    max-width: 680px; /* Tối ưu cho bố cục 2 cột */
    background: #ffffff;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 10px 25px -5px rgb(39 9 9 / 46%);
}

.vwd-aff-logo-area {
    text-align: center; /* Căn giữa logo */
    display: flex;
    justify-content: center;
    align-items: center;
}

.vwd-aff-logo-area img {
    /* Vì ảnh là hình vuông 500x500 nhưng chứa logo nằm ngang, 
       chúng ta nên tăng chiều rộng lên để nhìn rõ nội dung */
    width: 120px; /* Tăng chiều rộng hiển thị */
    height: auto; /* Để chiều cao tự nhảy theo tỉ lệ 1:1 (cũng sẽ là 120px) */

    /* Căn chỉnh lại khoảng cách */
    margin-top: -20px; /* Đẩy lên một chút nếu ảnh có viền trắng thừa bên trên */
    margin-bottom: -10px; /* Giảm bớt khoảng trống thừa bên dưới */

    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.05));
    transition: transform 0.3s ease;
}

.vwd-aff-card-header {
    text-align: center;
}

.vwd-aff-card-header h1 {
    font-size: 25px;
    font-weight: 700;
    color: #383a3e;
    margin: 0 0 8px;
    font-family: "Plus Jakarta Sans";
}

/* --- BỐ CỤC GRID --- */
.vwd-aff-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Chia 2 cột đều nhau */
    gap: 15px 25px; /* Khoảng cách hàng 15px, cột 25px */
}

.vwd-aff-field-group {
    margin-bottom: 5px;
}

/* Ép các ô như Điều khoản, Nút bấm chiếm hết 2 cột */
.vwd-aff-full-width {
    grid-column: span 2;
}

.vwd-aff-field-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--vwd-text);
}

.vwd-aff-input-box {
    position: relative;
    display: flex;
    align-items: center;
}

.vwd-aff-icon {
    position: absolute;
    left: 15px;
    color: var(--vwd-text-light);
    font-size: 14px;
    pointer-events: none; /* Tránh icon che mất sự kiện click vào input */
}

.vwd-aff-input-box input {
    width: 100%;
    padding: 12px 15px 12px 42px !important; /* Lùi text để không đè icon */
    border: 1.5px solid var(--vwd-border);
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.vwd-aff-input-box input:focus {
    border-color: var(--vwd-primary);
    box-shadow: 0 0 0 4px rgba(26, 86, 219, 0.1);
}

.vwd-aff-input-box select {
    width: 100%;
    padding: 10px 20px 10px 42px !important;
    border: 1.5px solid var(--vwd-border);
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    appearance: none; /* Xóa style mặc định của trình duyệt */
    background-color: transparent;
    line-height: 1.2; /* Cố định chiều cao dòng để chữ không bị nhảy */
    display: flex;
    align-items: center;
}

/* Đảm bảo khung chứa select có chiều cao cố định */
.vwd-aff-select-box {
    min-height: 48px;
}

/* Checkbox Điều khoản */
.vwd-aff-terms {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--vwd-text-light);
    margin: 10px 0 15px;
    cursor: pointer;
}

.vwd-aff-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--vwd-text-light);
    cursor: pointer;
    margin-bottom: 20px;
    user-select: none;
}

.vwd-aff-checkbox-label a {
    color: var(--vwd-primary);
    text-decoration: none;
    font-weight: 600;
}

.vwd-aff-checkbox-label a:hover {
    text-decoration: underline;
}

.vwd-aff-terms input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--vwd-primary);
}

.vwd-aff-full-row {
    grid-column: span 2; /* Đảm bảo chiếm hết 2 cột của Grid */
    margin-top: 10px;
}

.vwd-aff-btn-primary {
    width: 100%;
    padding: 14px 20px;
    background-color: var(--vwd-primary);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(26, 86, 219, 0.2);
}

.vwd-aff-btn-primary:hover {
    background-color: var(--vwd-primary-hover);
    transform: translateY(-1px); /* Hiệu ứng nhấc nhẹ nút khi di chuột */
    box-shadow: 0 10px 15px -3px rgba(26, 86, 219, 0.3);
}

.vwd-aff-btn-primary:active {
    transform: translateY(0);
}

/* Hiệu ứng cho mũi tên trong nút */
.vwd-aff-btn-primary i {
    transition: transform 0.3s ease;
}

.vwd-aff-btn-primary:hover i {
    transform: translateX(4px); /* Mũi tên nhích sang phải khi hover */
}

.vwd-aff-card-footer {
    text-align: center;
    margin-top: 25px;
    font-size: 14px;
    color: var(--vwd-text-light);
}

.vwd-aff-card-footer a {
    color: var(--vwd-primary);
    text-decoration: none;
    font-weight: 600;
}
