/* Reset và cài đặt chung */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: #333;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    /* Sử dụng ảnh từ máy tính của bạn */
    background-image: url('background.jpg'); /* Thay đổi tên file tại đây */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative;
}

/* Lớp phủ tối để tăng độ tương phản cho nội dung */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Điều chỉnh độ tối tại đây */
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Container đăng nhập */
.login-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    padding: 40px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: fadeIn 0.8s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.title {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(90deg, #6a11cb, #2575fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 18px;
    color: #666;
    font-weight: 500;
    letter-spacing: 1px;
}

/* Form đăng nhập */
.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form-header h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.form-header h2 i {
    color: #6a11cb;
}

.form-header p {
    color: #666;
    font-size: 15px;
}

/* Nhập liệu */
.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group label i {
    color: #6a11cb;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 16px 20px 16px 50px;
    border: 2px solid #e1e1e1;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.9);
    font-family: 'Courier New', monospace;
    font-weight: 600;
    letter-spacing: 1px;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #6a11cb;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.2);
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #6a11cb;
    font-size: 18px;
}

.input-hint {
    margin-top: 8px;
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-hint i {
    color: #2575fc;
}

/* Nút đăng nhập */
.login-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(90deg, #6a11cb, #2575fc);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    box-shadow: 0 5px 15px rgba(106, 17, 203, 0.3);
    position: relative;
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(106, 17, 203, 0.4);
}

.login-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Loading spinner */
.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading .loading-spinner {
    display: inline-block;
}

/* Message */
.message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
    display: none;
    animation: fadeIn 0.5s ease-out;
    line-height: 1.6;
}

.message strong {
    font-size: 1.1em;
}

.message.success {
    background-color: rgba(46, 204, 113, 0.1);
    color: #27ae60;
    border: 1px solid #27ae60;
    display: block;
}

.message.error {
    background-color: rgba(231, 76, 60, 0.1);
    color: #c0392b;
    border: 1px solid #c0392b;
    display: block;
}

/* System info */
.system-info {
    margin-top: 30px;
    padding: 20px;
    background-color: rgba(240, 247, 255, 0.8);
    border-radius: 12px;
    border-left: 4px solid #2575fc;
}

.system-info h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.system-info h3 i {
    color: #2575fc;
}

/* Member count */
.member-count {
    background: linear-gradient(90deg, #6a11cb, #2575fc);
    color: white;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 15px;
    font-weight: 600;
}

.member-count i {
    margin-right: 8px;
}

/* Sections trong danh sách MSSV */
.members-section, .others-section {
    margin-bottom: 20px;
}

.members-section h4, .others-section h4 {
    font-size: 16px;
    color: #444;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Danh sách MSSV */
.mssv-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border: 1px solid #eee;
}

.mssv-list p {
    color: #666;
    font-size: 14px;
    text-align: center;
    padding: 10px;
}

.mssv-item {
    padding: 10px 12px;
    margin-bottom: 8px;
    background: linear-gradient(90deg, rgba(106, 17, 203, 0.05), rgba(37, 117, 252, 0.05));
    border-radius: 8px;
    border-left: 4px solid #2575fc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.mssv-item:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.mssv-item strong {
    color: #6a11cb;
    font-size: 15px;
}

.mssv-item small {
    color: #666;
    font-size: 13px;
}

.mssv-role {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.mssv-role.member {
    background: rgba(106, 17, 203, 0.1);
    color: #6a11cb;
}

.mssv-role.teacher {
    background: rgba(255, 152, 0, 0.1);
    color: #f57c00;
}

.mssv-role.admin {
    background: rgba(194, 24, 91, 0.1);
    color: #c2185b;
}

/* More members indicator */
.more-members {
    text-align: center;
    color: #888;
    font-size: 13px;
    font-style: italic;
    padding: 8px;
    border-top: 1px dashed #ddd;
    margin-top: 10px;
}

/* Thêm hiệu ứng shake */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Thông tin hỗ trợ */
.support-info {
    margin-top: 30px;
    padding: 15px;
    background-color: rgba(240, 247, 255, 0.8);
    border-radius: 10px;
    border-left: 4px solid #2575fc;
}

.support-info p {
    font-size: 14px;
    color: #444;
    display: flex;
    align-items: center;
    gap: 10px;
}

.support-info i {
    color: #2575fc;
}

/* Footer */
.footer {
    margin-top: 30px;
    text-align: center;
    color: #666;
    font-size: 14px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.footer p {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.footer i {
    color: #6a11cb;
}

.copyright {
    font-size: 13px;
    color: #888;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    
    .login-container {
        padding: 30px 25px;
    }
    
    .title {
        font-size: 24px;
    }
    
    .subtitle {
        font-size: 16px;
    }
    
    .form-header h2 {
        font-size: 22px;
    }
    
    .system-info {
        padding: 15px;
    }
    
    .mssv-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .mssv-role {
        align-self: flex-start;
    }
}

/* Quick Access Buttons */
.quick-access {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(90deg, rgba(106, 17, 203, 0.1), rgba(37, 117, 252, 0.1));
    border-radius: 12px;
    border-left: 4px solid #6a11cb;
    text-align: center;
}

.quick-access p {
    margin-bottom: 15px;
    color: #444;
    font-size: 15px;
}

.calculator-btn, .logout-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 5px;
}

.calculator-btn {
    background: linear-gradient(90deg, #6a11cb, #2575fc);
    color: white;
    box-shadow: 0 4px 12px rgba(106, 17, 203, 0.3);
    margin-bottom: 20px;

}

.logout-btn {
    background: rgba(231, 76, 60, 0.1);
    color: #c0392b;
    border: 2px solid #c0392b;
}

.calculator-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(106, 17, 203, 0.4);
}

.logout-btn:hover {
    background: rgba(231, 76, 60, 0.2);
    transform: translateY(-2px);
}

/* Loading spinner trong nút */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive cho buttons */
@media (max-width: 600px) {
    .calculator-btn, .logout-btn {
        width: 100%;
        margin: 5px 0;
    }
    
    .quick-access {
        padding: 15px;
    }
}

/* Hiệu ứng tuyết rơi */
.snowflake {
    position: fixed;
    top: -10px;
    color: #ffffff;
    font-size: 1em;
    pointer-events: none;
    user-select: none;
    z-index: 9999; /* Luôn trên cùng */
    opacity: 0.9;
    animation-name: snowFall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

@keyframes snowFall {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(100vh) rotate(360deg); }
}

/* Toast base */
/* Base giữ nguyên */
.toast{
  position: fixed;
  z-index: 999999;
  padding: 12px 16px;
  border-radius: 16px;
  font-weight: 800;
  letter-spacing: .4px;
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
  opacity: 0;
  transform: translateY(-10px) scale(.98);
  transition: .22s ease;
  user-select: none;
}

/* Show */
.toast.show{
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Types */
.toast-success{
  background: rgba(20,20,20,.92);
  color: #fff;
  border: 1px solid rgba(60,220,120,.55);
}

/* ✅ ERROR: viền đỏ, chữ đỏ, nền trắng */
.toast-error{
  background: #fff;
  color: #d10000;               /* chữ đỏ */
  border: 3px solid #d10000;    /* viền đỏ */
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
}

/* Positions */
.toast-top-right{ top: 18px; right: 18px; }
.toast-center{
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.98);
}
.toast-center.show{
  transform: translate(-50%, -50%) scale(1);
}

/* Sizes */
.toast-normal{ font-size: 14px; }
.toast-big{
  font-size: 90px;
  padding: 34px 50px;
  border-radius: 24px;
  text-transform: uppercase;
}

