/* Modern Login Page Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Vietnam National Day Background Effects */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 80%, rgba(220, 38, 38, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 215, 0, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(220, 38, 38, 0.1) 0%, transparent 50%);
    animation: vietnamBackgroundMove 25s ease-in-out infinite;
    z-index: -1;
}

/* Floating Stars Animation */
body::after {
    content: '⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-size: 20px;
    color: rgba(255, 215, 0, 0.6);
    animation: floatingStars 30s linear infinite;
    pointer-events: none;
    z-index: -1;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: flex-start;
    padding: 20px;
}

@keyframes vietnamBackgroundMove {
    0%, 100% {
        transform: translateX(0) translateY(0) rotate(0deg);
        filter: hue-rotate(0deg);
    }
    25% {
        transform: translateX(-30px) translateY(-15px) rotate(1deg);
        filter: hue-rotate(10deg);
    }
    50% {
        transform: translateX(30px) translateY(15px) rotate(-1deg);
        filter: hue-rotate(20deg);
    }
    75% {
        transform: translateX(-15px) translateY(30px) rotate(0.5deg);
        filter: hue-rotate(10deg);
    }
}

@keyframes floatingStars {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Vietnam Flag Colors Decoration */
.vietnam-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.vietnam-decoration::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        linear-gradient(45deg, transparent 30%, rgba(220, 38, 38, 0.05) 35%, rgba(220, 38, 38, 0.05) 40%, transparent 45%),
        linear-gradient(-45deg, transparent 30%, rgba(255, 215, 0, 0.05) 35%, rgba(255, 215, 0, 0.05) 40%, transparent 45%);
    animation: vietnamStripes 20s linear infinite;
}

@keyframes vietnamStripes {
    0% { transform: translateX(-100%) translateY(-100%) rotate(0deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(360deg); }
}

/* Login Page Container */
.modern-login-page {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.login-container {
    position: relative;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    overflow: hidden;
    position: relative;
    padding: 40px;
    transition: all 0.3s ease;
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.3);
}

/* Vietnam National Day Card Decoration */
.card-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #dc2626, #ffd700, #dc2626, #ffd700, #dc2626);
    background-size: 300% 100%;
    animation: vietnamGradientShift 4s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

@keyframes vietnamGradientShift {
    0%, 100% {
        background-position: 0% 50%;
        box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
    }
    50% {
        background-position: 100% 50%;
        box-shadow: 0 2px 12px rgba(255, 215, 0, 0.4);
    }
}

/* Fireworks Effect */
.fireworks {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #ffd700 0%, #dc2626 50%, transparent 70%);
    border-radius: 50%;
    animation: fireworkExplode 3s ease-out infinite;
}

.firework:nth-child(1) { top: 20%; left: 20%; animation-delay: 0s; }
.firework:nth-child(2) { top: 30%; left: 80%; animation-delay: 1s; }
.firework:nth-child(3) { top: 60%; left: 15%; animation-delay: 2s; }
.firework:nth-child(4) { top: 40%; left: 70%; animation-delay: 0.5s; }
.firework:nth-child(5) { top: 70%; left: 50%; animation-delay: 1.5s; }

@keyframes fireworkExplode {
    0% {
        transform: scale(0);
        opacity: 1;
        box-shadow:
            0 0 0 0 rgba(255, 215, 0, 0.8),
            0 0 0 0 rgba(220, 38, 38, 0.8);
    }
    50% {
        transform: scale(1);
        opacity: 0.8;
        box-shadow:
            0 0 20px 10px rgba(255, 215, 0, 0.4),
            0 0 30px 15px rgba(220, 38, 38, 0.3);
    }
    100% {
        transform: scale(2);
        opacity: 0;
        box-shadow:
            0 0 40px 20px rgba(255, 215, 0, 0.1),
            0 0 50px 25px rgba(220, 38, 38, 0.1);
    }
}

/* Header */
.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-container {
    margin-bottom: 20px;
}

.logo {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    box-shadow:
        0 8px 24px rgba(220, 38, 38, 0.2),
        0 0 20px rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
    border: 3px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(45deg, #dc2626, #ffd700, #dc2626) border-box;
}

.logo:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow:
        0 12px 32px rgba(220, 38, 38, 0.3),
        0 0 30px rgba(255, 215, 0, 0.5);
}

.login-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #dc2626, #ffd700, #dc2626);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 100%;
    animation: vietnamTitleGlow 3s ease-in-out infinite;
    text-shadow: 0 2px 4px rgba(220, 38, 38, 0.1);
    position: relative;
}

.login-title::after {
    content: '🇻🇳';
    position: absolute;
    top: -10px;
    right: -40px;
    font-size: 24px;
    animation: flagWave 2s ease-in-out infinite;
}

@keyframes vietnamTitleGlow {
    0%, 100% {
        background-position: 0% 50%;
        filter: brightness(1);
    }
    50% {
        background-position: 100% 50%;
        filter: brightness(1.2);
    }
}

@keyframes flagWave {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-10deg) scale(1.1); }
    75% { transform: rotate(10deg) scale(1.1); }
}

.login-subtitle {
    font-size: 18px;
    color: #dc2626;
    font-weight: 600;
    margin-bottom: 8px;
    text-shadow: 0 1px 2px rgba(220, 38, 38, 0.2);
    animation: vietnamSubtitleGlow 3s ease-in-out infinite;
}

.login-subtitle-2 {
    font-size: 14px;
    color: #64748b;
    font-weight: 400;
}

@keyframes vietnamSubtitleGlow {
    0%, 100% {
        color: #dc2626;
        text-shadow: 0 1px 2px rgba(220, 38, 38, 0.2);
    }
    50% {
        color: #ffd700;
        text-shadow: 0 1px 4px rgba(255, 215, 0, 0.4);
    }
}

/* Alerts */
.modern-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.modern-alert.error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.modern-alert.success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Form Styles */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.input-container {
    position: relative;
}

.input-wrapper {
    position: relative;
}

.modern-input {
    width: 100%;
    padding: 16px 20px 16px 50px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 400;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    outline: none;
}

.modern-input:focus {
    border-color: #dc2626;
    background: rgba(255, 255, 255, 1);
    box-shadow:
        0 0 0 3px rgba(220, 38, 38, 0.1),
        0 0 10px rgba(255, 215, 0, 0.2);
}

.modern-input:focus + .input-label {
    transform: translateY(-28px) scale(0.85);
    color: #dc2626;
    text-shadow: 0 1px 2px rgba(220, 38, 38, 0.2);
}

.modern-input:not(:placeholder-shown) + .input-label {
    transform: translateY(-28px) scale(0.85);
    color: #64748b;
}

.input-label {
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #94a3b8;
    pointer-events: none;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    padding: 0 8px;
    border-radius: 4px;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 18px;
    transition: color 0.3s ease;
}

.modern-input:focus ~ .input-icon {
    color: #dc2626;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.password-toggle:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #64748b;
}

.checkbox-container input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.forgot-link {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: #5a67d8;
    text-decoration: underline;
}

/* Vietnam National Day Login Button */
.login-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #dc2626 0%, #ffd700 50%, #dc2626 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    background-size: 200% 100%;
    animation: vietnamButtonGlow 4s ease-in-out infinite;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow:
        0 4px 15px rgba(220, 38, 38, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.login-btn::after {
    content: '⭐';
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    font-size: 14px;
    animation: starTwinkle 2s ease-in-out infinite;
    opacity: 0.8;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    transform: translateY(-3px);
    box-shadow:
        0 15px 35px rgba(220, 38, 38, 0.4),
        0 5px 15px rgba(255, 215, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background-position: 100% 0;
}

.login-btn:active {
    transform: translateY(-1px);
}

.btn-icon {
    transition: transform 0.3s ease;
}

.login-btn:hover .btn-icon {
    transform: translateX(4px) rotate(15deg);
}

@keyframes vietnamButtonGlow {
    0%, 100% {
        background-position: 0% 50%;
        box-shadow:
            0 4px 15px rgba(220, 38, 38, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% {
        background-position: 100% 50%;
        box-shadow:
            0 4px 15px rgba(255, 215, 0, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

@keyframes starTwinkle {
    0%, 100% {
        opacity: 0.8;
        transform: translateY(-50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(-50%) scale(1.2);
    }
}

/* Additional Links */
.login-links {
    margin-top: 32px;
    text-align: center;
}

.register-link {
    font-size: 14px;
    color: #64748b;
}

.link-primary {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    margin-left: 8px;
    transition: color 0.3s ease;
}

.link-primary:hover {
    color: #5a67d8;
    text-decoration: underline;
}

/* Divider */
.divider {
    margin: 32px 0 24px;
    text-align: center;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
}

.divider-text {
    background: rgba(255, 255, 255, 0.95);
    padding: 0 16px;
    color: #64748b;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

/* Google Button */
.google-btn {
    width: 100%;
    padding: 16px 24px;
    background: #ffffff;
    color: #374151;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.google-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.google-btn i {
    color: #ea4335;
    font-size: 18px;
}

/* Responsive Design */
@media (max-width: 480px) {
    .modern-login-page {
        max-width: 100%;
        margin: 0;
    }

    .login-card {
        padding: 32px 24px;
        margin: 0 16px;
        border-radius: 20px;
    }

    .login-title {
        font-size: 28px;
    }

    .modern-input {
        padding: 14px 18px 14px 46px;
        font-size: 16px;
    }

    .input-label {
        left: 46px;
        font-size: 15px;
    }

    .input-icon {
        left: 16px;
        font-size: 16px;
    }

    .login-btn, .google-btn {
        padding: 14px 20px;
        font-size: 15px;
    }
}

/* Loading state */
.login-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.login-btn.loading .btn-text {
    opacity: 0;
}

.login-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
