@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

/* FIX: Đảm bảo body luôn full màn hình và căn giữa cứng */
html,
body {
    width: 100%;
    height: 100vh;
    margin: 0;
    overflow: hidden;
    /* Chặn cuộn trang */
}

body {
    background: radial-gradient(circle at 20% 20%, #101530, #02040a);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Hiệu ứng background di chuyển */
.bg-animation {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, #0a2463, #02040a);
    animation: move-bg 15s infinite alternate ease-in-out;
    z-index: -2;
}

@keyframes move-bg {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(10%, 10%);
    }
}

/* Hiệu ứng hạt di chuyển */
.particles span {
    position: absolute;
    background: #00b4ff;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    box-shadow: 0 0 8px #00b4ff;
    animation: float 8s linear infinite;
    opacity: 0;
    /* Mặc định ẩn để tránh nháy */
}

.particles span:nth-child(1) {
    top: 10%;
    left: 20%;
    animation-delay: 0s;
}

.particles span:nth-child(2) {
    top: 60%;
    left: 80%;
    animation-delay: 1s;
}

.particles span:nth-child(3) {
    top: 50%;
    left: 30%;
    animation-delay: 2s;
}

.particles span:nth-child(4) {
    top: 80%;
    left: 50%;
    animation-delay: 3s;
}

.particles span:nth-child(5) {
    top: 30%;
    left: 70%;
    animation-delay: 4s;
}

@keyframes float {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }

    20% {
        opacity: 0.8;
    }

    50% {
        transform: translateY(-40px) scale(1.2);
        opacity: 1;
    }

    80% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }
}

/* Form chính - FIX: Loại bỏ animation slideUp gây lỗi vị trí */
.login-container {
    background: rgba(20, 25, 40, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 0 35px #00b4ff70, inset 0 0 20px #000;
    width: 100%;
    max-width: 400px;
    /* Đảm bảo không vỡ trên mobile */
    text-align: center;
    color: white;
    position: relative;
    /* Đảm bảo z-index hoạt động */
    z-index: 10;
    /* Nếu muốn animation mượt mà không vỡ layout, dùng opacity */
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo */
.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #00b4ff;
    text-shadow: 0 0 15px #00b4ff;
    margin-bottom: 5px;
}

.logo span {
    color: #ff0066;
    text-shadow: 0 0 20px #ff0066;
}

.logo p {
    font-size: 0.9rem;
    color: #aaa;
    margin-top: 0;
}

/* Form nội dung */
.login-form {
    margin-top: 25px;
}

.login-form h2 {
    margin-bottom: 20px;
    font-weight: 600;
    color: #ffffffd9;
}

.input-group {
    position: relative;
    margin-bottom: 18px;
    width: 100%;
}

.input-group i {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: #00b4ff;
    font-size: 1.1rem;
    z-index: 2;
}

.input-group input {
    width: 100%;
    padding: 12px 12px 12px 45px;
    /* Tăng padding để icon không đè chữ */
    background: #1b2235;
    border: 2px solid transparent;
    border-radius: 10px;
    color: white;
    transition: 0.3s;
    font-size: 1rem;
}

.input-group input:focus {
    border-color: #00b4ff;
    outline: none;
    background: #11182b;
    box-shadow: 0 0 10px rgba(0, 180, 255, 0.3);
}

/* Nút đăng nhập chính */
.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(90deg, #00b4ff, #0077ff);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s ease;
    box-shadow: 0 0 12px #00b4ff70;
    margin-top: 10px;
}

.login-btn:hover {
    background: linear-gradient(90deg, #0099ff, #0055ff);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 180, 255, 0.6);
}

/* Thông báo lỗi */
.error-msg {
    color: #ff4f6d;
    margin-bottom: 15px;
    font-weight: 500;
    background: rgba(255, 79, 109, 0.1);
    padding: 8px;
    border-radius: 5px;
    font-size: 0.9rem;
}

/* Mạng xã hội */
.social-login {
    margin: 25px 0;
    width: 100%;
}

.social-login p {
    margin-bottom: 15px;
    color: #aaa;
    font-size: 0.9rem;
    position: relative;
}

.social-login p::before,
.social-login p::after {
    content: "";
    display: block;
    width: 30%;
    height: 1px;
    background: #333;
    position: absolute;
    top: 50%;
}

.social-login p::before {
    left: 0;
}

.social-login p::after {
    right: 0;
}

.social-buttons-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* Google button Container */
.google-buttons-container {
    width: 100%;
    height: 42px;
    /* Cố định chiều cao để tránh giật layout */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Facebook button Container */
.facebook-buttons-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.facebook-btn {
    width: 100%;
    /* Full width cho đẹp */
    height: 40px;
    /* Bằng chiều cao chuẩn google */
    border-radius: 4px;
    /* Google chuẩn thường vuông hơn xíu, chỉnh cho hợp */
    font-size: 0.95rem;
    /* Cân bằng font */
    background: #1877f2;
    color: #fff;
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.3s;
    font-family: 'Roboto', sans-serif;
    /* Font giống Google */
}

.facebook-btn:hover {
    background: #166fe5;
}

.facebook-btn i {
    font-size: 1.1rem;
}

/* Liên kết phụ */
.extra-links {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    font-size: 0.9rem;
}

.extra-links a {
    text-decoration: none;
    transition: 0.3s;
}

.forgot {
    color: #aaa;
}

.forgot:hover {
    color: #fff;
}

.register {
    color: #00b4ff;
    font-weight: 600;
}

.register:hover {
    color: #0099ff;
    text-shadow: 0 0 10px #00b4ff;
}