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

body {
    font-family: 'Prompt', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #8b0000 0%, #dc3545 100%);
    background-image: url('../img/login/bg-xl-login.jpg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 460px;
    background: transparent;
    padding: 0;
    animation: fadeIn 0.5s ease-in-out;
}

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

.login-header {
    text-align: center;
    margin-bottom: 45px;
    position: relative;
}

.logo-image {
    max-width: 100%;
    height: auto;
    max-height: 180px;
    display: block;
    margin: 0 auto;
    object-fit: contain;
    position: relative;
    z-index: 1;
    animation: logoFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 5px 25px rgba(255, 255, 255, 0.5));
    will-change: transform;
}

/* Logo Floating Animation - Ultra Smooth */
@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

/* Sparkle Container */
.login-header::before,
.login-header::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 2;
}

/* Sparkle Points */
.login-header::before {
    background-image: 
        radial-gradient(circle, rgba(255, 255, 255, 0.8) 1px, transparent 1px),
        radial-gradient(circle, rgba(255, 255, 255, 0.6) 1.5px, transparent 1.5px),
        radial-gradient(circle, rgba(255, 255, 255, 0.9) 1px, transparent 1px),
        radial-gradient(circle, rgba(255, 255, 255, 0.7) 1px, transparent 1px),
        radial-gradient(circle, rgba(255, 255, 255, 0.5) 2px, transparent 2px);
    background-size: 
        80% 80%,
        70% 70%,
        90% 90%,
        85% 85%,
        75% 75%;
    background-position: 
        15% 20%,
        75% 15%,
        25% 70%,
        80% 65%,
        50% 40%;
    background-repeat: no-repeat;
    animation: sparkle 3s ease-in-out infinite;
}

.login-header::after {
    background-image: 
        radial-gradient(circle, rgba(255, 255, 255, 0.9) 1px, transparent 1px),
        radial-gradient(circle, rgba(255, 255, 255, 0.7) 1.5px, transparent 1.5px),
        radial-gradient(circle, rgba(255, 255, 255, 0.6) 1px, transparent 1px),
        radial-gradient(circle, rgba(255, 255, 255, 0.8) 1px, transparent 1px);
    background-size: 
        85% 85%,
        65% 65%,
        95% 95%,
        80% 80%;
    background-position: 
        35% 25%,
        65% 75%,
        45% 55%,
        20% 80%;
    background-repeat: no-repeat;
    animation: sparkle 3s ease-in-out infinite 1.5s;
}

/* Sparkle Animation */
@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Star Flares - Cross shape sparkles */
.login-header .logo-image.logo-image::before,
.login-header .logo-image::after {
    content: '';
    position: absolute;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.8), transparent);
    animation: flare 2.5s ease-in-out infinite;
    pointer-events: none;
}

.login-header .logo-image::before {
    width: 40px;
    height: 1px;
    top: 20%;
    right: 15%;
    animation-delay: 0.5s;
}

.login-header .logo-image::after {
    width: 1px;
    height: 40px;
    top: calc(20% - 20px);
    right: calc(15% + 19.5px);
    animation-delay: 0.5s;
}

@keyframes flare {
    0%, 100% {
        opacity: 0;
        transform: scale(0);
    }
    40%, 60% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Individual Sparkle Points */
.sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 3;
    animation: twinkle 2s ease-in-out infinite;
}

/* Cross-shaped flare on sparkles */
.sparkle::before,
.sparkle::after {
    content: '';
    position: absolute;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.8), transparent);
}

.sparkle::before {
    width: 12px;
    height: 1px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.sparkle::after {
    width: 1px;
    height: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Position each sparkle */
.sparkle-1 {
    top: 15%;
    left: 20%;
    animation-delay: 0s;
    animation-duration: 2.5s;
}

.sparkle-2 {
    top: 25%;
    right: 15%;
    animation-delay: 0.8s;
    animation-duration: 3s;
}

.sparkle-3 {
    top: 60%;
    left: 15%;
    animation-delay: 1.5s;
    animation-duration: 2.8s;
}

.sparkle-4 {
    top: 70%;
    right: 25%;
    animation-delay: 0.5s;
    animation-duration: 3.2s;
}

.sparkle-5 {
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 2s;
    animation-duration: 2.6s;
}

/* Twinkle Animation */
@keyframes twinkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.2) rotate(180deg);
    }
}

.game-title {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
    font-weight: 400;
}

.game-subtitle {
    font-size: 42px;
    font-weight: 700;
    color: #ec1b1b;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.badge {
    display: inline-block;
    background: #ec1b1b;
    color: white;
    padding: 6px 20px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.login-form {
    margin-bottom: 0;
    margin-top: 0;
}

.form-group {
    margin-bottom: 16px;
    position: relative;
}

.form-group input {
    width: 100%;
    padding: 15px 50px 15px 18px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Prompt', sans-serif;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
    color: #374151;
}

.form-group input:focus {
    outline: none;
    border-color: #ec1b1b;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 3px rgba(236, 27, 27, 0.15);
}

.form-group input::placeholder {
    color: #9ca3af;
}

.input-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    width: 20px;
    height: 20px;
}

.input-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.toggle-password {
    cursor: pointer;
    pointer-events: auto;
    transition: color 0.2s ease;
}

.toggle-password:hover {
    color: #ec1b1b;
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    margin-top: 8px;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: #ec1b1b;
}

.forgot-password {
    color: #ff5252;
    text-decoration: none;
    font-weight: 400;
    font-size: 14px;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #ec1b1b;
    text-decoration: underline;
}

.btn-login {
    width: 100%;
    padding: 15px;
    background: #ec1b1b;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 600;
    font-family: 'Prompt', sans-serif;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-login:hover {
    background: #8d0000;
}

.btn-login:active {
    background: #ec1b1b;
}

.divider {
    text-align: center;
    margin: 22px 0;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 43%;
    height: 1px;
    background: #cbd5e0;
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.divider span {
    background: transparent;
    padding: 0 15px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.btn-register {
    width: 100%;
    padding: 15px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 600;
    font-family: 'Prompt', sans-serif;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-register:hover {
    background: #5a6268;
}

.btn-register:active {
    background: #545b62;
}

.footer-links {
    text-align: center;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #cbd5e0;
}

.footer-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
}

.footer-link {
    color: #ff5252;
    text-decoration: none;
    font-weight: 400;
}

.footer-link:hover {
    text-decoration: underline;
}

.copyright {
    text-align: center;
    margin-top: 30px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    max-width: 460px;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    body {
        background-image: url('../img/login/bg-login.png');
    }

    .login-container {
        max-width: 480px;
        padding: 30px 35px;
    }

    .game-subtitle {
        font-size: 24px;
    }

    .game-title {
        font-size: 13px;
    }

    .form-group input {
        padding: 12px 40px 12px 14px;
        font-size: 14px;
    }

    .btn-login,
    .btn-register {
        padding: 12px;
        font-size: 14px;
    }

    .remember-forgot {
        font-size: 11px;
    }
}

@media screen and (max-width: 480px) {
    body {
        padding: 15px;
    }

    .login-container {
        max-width: 420px;
        padding: 28px 30px;
    }

    .logo-image {
        max-height: 110px;
    }

    .game-subtitle {
        font-size: 24px;
    }

    .game-title {
        font-size: 16px;
    }

    .badge {
        font-size: 9px;
        padding: 3px 14px;
    }

    .form-group input {
        padding: 11px 35px 11px 12px;
        font-size: 13px;
    }

    .btn-login,
    .btn-register {
        padding: 11px;
        font-size: 14px;
    }

    .remember-forgot {
        font-size: 11px;
    }

    .footer-text {
        font-size: 10px;
    }

    .copyright {
        font-size: 10px;
    }
}

@media screen and (max-width: 360px) {
    .login-container {
        max-width: 340px;
        padding: 25px 25px;
    }

    .game-subtitle {
        font-size: 16px;
    }

    .login-header {
        margin-bottom: 28px;
    }

    .form-group {
        margin-bottom: 10px;
    }
}

/* Loading Animation */
.btn-login.loading {
    position: relative;
    color: transparent;
}

.btn-login.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error Popup */
.error-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
    padding: 20px;
}

.error-popup.show {
    display: flex;
}

.error-popup-content {
    background: white;
    padding: 35px 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideDown 0.3s ease;
    text-align: center;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-popup-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounce 0.5s ease;
    flex-shrink: 0;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.error-popup-icon svg {
    width: 34px;
    height: 34px;
    color: white;
}

.error-popup-message {
    font-size: 15px;
    color: #374151;
    line-height: 1.8;
    margin-bottom: 24px;
    font-weight: 400;
    white-space: pre-line;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.error-popup-btn {
    width: 100%;
    padding: 14px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Prompt', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.error-popup-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.error-popup-btn:active {
    background: #545b62;
    transform: translateY(0);
}

/* Success Popup */
.success-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
    padding: 20px;
}

.success-popup.show {
    display: flex;
}

.success-popup-content {
    background: white;
    padding: 35px 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideDown 0.3s ease;
    text-align: center;
}

.success-popup-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounce 0.5s ease;
    flex-shrink: 0;
}

.success-popup-icon svg {
    width: 34px;
    height: 34px;
    color: white;
}

.success-popup-message {
    font-size: 15px;
    color: #374151;
    line-height: 1.8;
    margin-bottom: 0;
    font-weight: 400;
    white-space: pre-line;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Responsive Popup for Mobile */
@media (max-width: 480px) {
    .error-popup {
        padding: 15px;
    }
    
    .error-popup-content,
    .success-popup-content {
        padding: 30px 25px;
        max-width: 100%;
        border-radius: 12px;
    }
    
    .error-popup-icon,
    .success-popup-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 20px;
    }
    
    .error-popup-icon svg,
    .success-popup-icon svg {
        width: 30px;
        height: 30px;
    }
    
    .error-popup-message,
    .success-popup-message {
        font-size: 14px;
        line-height: 1.7;
        margin-bottom: 20px;
    }
    
    .error-popup-btn,
    .success-popup-btn {
        padding: 12px;
        font-size: 14px;
    }
}

