/**
 * ============================================================
 * auth.css — Giao diện trang Đăng nhập / Đăng ký
 * Dùng cho: login.html
 * Import sau style.css
 * ============================================================
 */

/* ----------------------------------------------------------
   LAYOUT TRANG AUTH
   Căn giữa form theo chiều dọc và ngang
---------------------------------------------------------- */
.auth-page {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

/* ----------------------------------------------------------
   HỘP CHỨA FORM
   Khung ngoài bao quanh cả 2 tab + form
---------------------------------------------------------- */
.auth-container {
    background: #1a1a1a;
    border-radius: 14px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    border: 1px solid #2a2a2a;
}

/* ----------------------------------------------------------
   THANH TAB (Đăng nhập / Đăng ký)
   2 nút nằm ngang trên cùng của form
---------------------------------------------------------- */
.auth-tabs {
    display: flex;
}

.auth-tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    background: #222;
    color: #888;
    border: none;
    border-bottom: 2px solid #2a2a2a;
    transition: 0.2s;
    font-family: inherit;
    letter-spacing: 0.3px;
}

/* Tab đang được chọn */
.auth-tab.active {
    background: #ff4c4c;
    color: white;
    border-bottom-color: #ff4c4c;
}

/* Hover tab chưa active */
.auth-tab:hover:not(.active) {
    background: #2a2a2a;
    color: white;
}

/* ----------------------------------------------------------
   FORM (ẩn mặc định, hiện khi có class .active)
---------------------------------------------------------- */
.auth-form {
    display: none;
    padding: 30px 28px;
    flex-direction: column;
    gap: 14px;
}

.auth-form.active {
    display: flex;
}

/* Tiêu đề form */
.auth-form h2 {
    margin: 0 0 2px 0;
    font-size: 20px;
    color: white;
    text-align: center;
}

/* Mô tả nhỏ dưới tiêu đề */
.auth-form .subtitle {
    text-align: center;
    color: #666;
    font-size: 13px;
}

/* ----------------------------------------------------------
   NHÓM INPUT (label + input)
---------------------------------------------------------- */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 12px;
    color: #aaa;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Ô nhập liệu */
.auth-form input {
    width: 100%;
    padding: 11px 13px;
    border-radius: 7px;
    border: 1.5px solid #333;
    background: #111;
    color: white;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
    outline: none;
    font-family: inherit;
}

/* Viền đỏ khi đang nhập */
.auth-form input:focus {
    border-color: #ff4c4c;
}

/* ----------------------------------------------------------
   NÚT GỬI FORM
---------------------------------------------------------- */
.auth-form .submit-btn {
    width: 100%;
    padding: 12px;
    margin-top: 4px;
    border: none;
    border-radius: 7px;
    background: #ff4c4c;
    color: white;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
    letter-spacing: 0.3px;
}

.auth-form .submit-btn:hover {
    background: #e03030;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(255, 76, 76, 0.35);
}

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

/* ----------------------------------------------------------
   DÒNG CHUYỂN TAB ở cuối form
   Ví dụ: "Chưa có tài khoản? Đăng ký ngay"
---------------------------------------------------------- */
.auth-switch {
    text-align: center;
    font-size: 13px;
    color: #666;
}

.auth-switch a {
    color: #ff4c4c;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
}

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

/* ----------------------------------------------------------
   LINK QUAY VỀ TRANG CHỦ ở cuối hộp
---------------------------------------------------------- */
.back-home {
    display: block;
    text-align: center;
    padding: 14px;
    color: #555;
    font-size: 13px;
    border-top: 1px solid #222;
    transition: color 0.2s;
    text-decoration: none;
}

.back-home:hover {
    color: #ff4c4c;
}

/* ----------------------------------------------------------
   THÔNG BÁO (lỗi / thành công)
   Hiện dưới dạng thanh màu khi có class .error hoặc .success
---------------------------------------------------------- */
.auth-message {
    padding: 10px 13px;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
    display: none; /* Ẩn mặc định */
}

.auth-message.success {
    background: #1a3a1a;
    color: #5cb85c;
    border: 1px solid #5cb85c55;
    display: block;
}

.auth-message.error {
    background: #3a1a1a;
    color: #ff4c4c;
    border: 1px solid #ff4c4c55;
    display: block;
}

/* ----------------------------------------------------------
   LIGHT MODE — ghi đè màu cho trang auth
---------------------------------------------------------- */
.light-mode .auth-container {
    background: #fff;
    border-color: #e0e0e0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.light-mode .auth-tab {
    background: #f5f5f5;
    color: #888;
    border-bottom-color: #ddd;
}

.light-mode .auth-tab:hover:not(.active) {
    background: #eee;
    color: #333;
}

.light-mode .auth-form h2 { color: #222; }
.light-mode .auth-form .subtitle { color: #999; }
.light-mode .input-group label { color: #777; }

.light-mode .auth-form input {
    background: #f5f5f5;
    border-color: #ccc;
    color: #222;
}

.light-mode .auth-form input:focus { border-color: #ff4c4c; }
.light-mode .auth-switch { color: #999; }
.light-mode .back-home { color: #aaa; border-top-color: #eee; }

/* ----------------------------------------------------------
   RESPONSIVE — màn hình nhỏ (dưới 440px)
---------------------------------------------------------- */
@media (max-width: 440px) {
    .auth-form {
        padding: 22px 18px;
    }

    .auth-tab {
        font-size: 14px;
        padding: 13px;
    }
}
