/* =================================================
   CSS CHO FORM ĐĂNG KÝ (register.css)
================================================= */

/* Box bọc ngoài form */
.member-form-wrapper {
    max-width: 450px;
    margin: 0 auto;
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* Thông báo lỗi */
.register-error-msg {
    background: #fef2f2;
    color: #ef4444;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
    border: 1px solid #fecaca;
    font-size: 14.5px;
    line-height: 1.6;
}

/* Các nhóm nhập liệu */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #334155;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #f8fafc;
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus {
    border-color: #3b82f6;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    outline: none;
}

/* =================================================
   CSS CHO NÚT CON MẮT (MẬT KHẨU)
================================================= */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    /* BƯỚC 1: Xóa margin-bottom ở đây để thẻ div báo lỗi nằm sát ô input */
    margin-bottom: 0; 
}

.password-wrapper input {
    margin-bottom: 0 !important; 
    padding-right: 45px !important;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%); 
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.toggle-password svg {
    width: 20px;
    height: 20px;
    color: #94a3b8;
    transition: all 0.2s ease;
    display: block;
}

.toggle-password:hover svg {
    color: #3b82f6;
    transform: scale(1.1);
}

/* =================================================
   Nút Đăng ký & Footer
================================================= */
.register-submit button {
    width: 100%;
    padding: 14px;
    background-color: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.1s ease;
    box-sizing: border-box;
    /* Thêm khoảng cách phía trên để tách biệt khỏi ô Mật khẩu */
    margin-top: 10px; 
}

.register-submit button:hover {
    background-color: #2563eb;
}

.register-submit button:active {
    transform: scale(0.98);
}

.form-footer-links {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14.5px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    clear: both;
}

.form-footer-text {
    color: #64748b;
    margin-right: 8px;
}

.form-footer-links a.footer-link {
    display: inline-block;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.form-footer-links a.footer-link:hover {
    color: #1d4ed8;
    background-color: #eff6ff;
}

/* =================================================
   THÔNG BÁO ĐÃ ĐĂNG NHẬP (Giao diện mới)
================================================= */
.logged-in-wrapper {
    text-align: center;
    padding: 40px 30px;
}

.logged-in-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    color: #10b981; /* Màu xanh lá */
    background: #d1fae5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logged-in-icon svg {
    width: 32px;
    height: 32px;
}

.logged-in-notice h3 {
    margin: 0 0 10px;
    color: #0f172a;
    font-size: 20px;
    font-weight: 700;
}

.logged-in-notice p {
    color: #64748b;
    margin: 0 0 25px;
    font-size: 15px;
}

.btn-home-return {
    display: inline-block;
    background: #3b82f6;
    color: #fff !important;
    padding: 12px 26px;
    border-radius: 8px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.btn-home-return:hover {
    background: #2563eb;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(59, 130, 246, 0.3);
}

/* =================================================
   CSS CHO THÔNG BÁO VALIDATION REAL-TIME (AJAX)
================================================= */
.live-validation-msg {
    margin-top: 6px;
    font-size: 13.5px;
    font-weight: 500;
    display: block;
    min-height: 20px; /* Giữ sẵn khoảng trống nhỏ để giao diện không bị giật lùi xuống khi dòng chữ hiện ra */
    transition: all 0.3s ease;
}

.live-validation-msg .status-loading {
    color: #64748b; /* Màu xám */
}

.live-validation-msg .status-error {
    color: #ef4444; /* Màu đỏ */
}

.live-validation-msg .status-success {
    color: #10b981; /* Màu xanh lá */
}

/* =================================================
   TRẠNG THÁI NÚT ĐĂNG KÝ BỊ KHÓA (DISABLED)
================================================= */
.register-submit button:disabled {
    background-color: #94a3b8; /* Chuyển màu xám */
    cursor: not-allowed;
    opacity: 0.7;
    transform: none; /* Bỏ hiệu ứng lún khi click */
}

.register-submit button:disabled:hover {
    background-color: #94a3b8; 
}