/* =========================================
   GIAO DIỆN TRANG ĐĂNG KÝ (AUTH PAGE)
   ========================================= */

/* Căn giữa form trên màn hình */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding-top: 64px; /* Trừ đi App Bar */
}

.auth-container {
    width: 100%;
    max-width: 450px;
    padding: 24px 16px;
}

.auth-card {
    padding: 32px;
}

/* Phần tiêu đề form */
.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.brand-logo {
    width: 64px;
    height: 64px;
    background-color: rgba(244, 67, 54, 0.1);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 16px;
}

.brand-logo i {
    font-size: 36px;
}

.auth-header h2 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 8px;
}

/* =========================================
   MATERIAL DESIGN INPUT (FLOATING LABEL)
   ========================================= */
.input-group {
    position: relative;
    margin-bottom: 24px;
}

/* Ô nhập liệu */
.material-input {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.05); /* Kiểu filled input */
    border: none;
    border-bottom: 1px solid var(--text-secondary);
    border-radius: 4px 4px 0 0;
    color: var(--on-surface);
    font-size: 16px;
    padding: 24px 16px 8px 16px;
    transition: border-color 0.2s, background-color 0.2s;
    outline: none;
}

.material-input:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.material-input:focus {
    border-bottom: 2px solid var(--primary);
    background-color: rgba(255, 255, 255, 0.1);
    padding-bottom: 7px; /* Cân bằng với viền 2px */
}

/* Nhãn (Label) trôi nổi */
.material-label {
    position: absolute;
    left: 16px;
    top: 16px;
    color: var(--text-secondary);
    font-size: 16px;
    pointer-events: none;
    transition: 0.2s ease all;
}

/* Hiệu ứng nhãn nổi lên khi focus hoặc khi có chữ */
.material-input:focus ~ .material-label,
.material-input:valid ~ .material-label {
    top: 6px;
    font-size: 12px;
    color: var(--primary);
}
.material-input:valid ~ .material-label {
    color: var(--text-secondary); /* Giữ màu nhạt nếu không focus nhưng có chữ */
}
.material-input:focus ~ .material-label {
    color: var(--primary); /* Đỏ khi đang focus */
}

/* Nút ẩn/hiện mật khẩu */
.pr-48 {
    padding-right: 48px; /* Chừa chỗ cho icon mắt */
}

.toggle-password {
    position: absolute;
    right: 4px;
    top: 12px;
    color: var(--text-secondary);
}

/* Thông báo lỗi */
.error-message {
    color: var(--primary);
    font-size: 12px;
    margin-top: 4px;
    margin-left: 16px;
    display: none; /* Ẩn mặc định */
}

.input-group.error .material-input {
    border-bottom-color: var(--primary);
}
.input-group.error .material-label {
    color: var(--primary);
}
.input-group.error .error-message {
    display: block;
}

/* =========================================
   MATERIAL DESIGN CHECKBOX
   ========================================= */
.checkbox-group {
    margin-bottom: 24px;
}

.material-checkbox {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.material-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 18px;
    width: 18px;
    background-color: transparent;
    border: 2px solid var(--text-secondary);
    border-radius: 2px;
    margin-right: 12px;
    transition: 0.2s;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.material-checkbox:hover input ~ .checkmark {
    border-color: #fff;
}

.material-checkbox input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Tạo dấu tick v */
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    width: 4px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.material-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-text {
    font-size: 14px;
    color: var(--on-surface);
}

.checkbox-group .error-message {
    margin-left: 30px; /* Thụt vào bằng dấu tick */
}

/* Layout phụ trợ */
.full-width {
    width: 100%;
}
.auth-submit {
    height: 48px;
    font-size: 15px;
    margin-bottom: 24px;
}
.auth-footer {
    text-align: center;
}
.font-medium {
    font-weight: 500;
}