/* login.css */

.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0f172a, #1e1b4b, #2e1065);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    font-family: 'Nunito', sans-serif;
}

.login-screen::before {
    content: "🏰";
    position: absolute;
    top: 10%;
    left: 10%;
    font-size: 3rem;
    opacity: 0.3;
    animation: float 6s ease-in-out infinite;
}

.login-screen::after {
    content: "🎢";
    position: absolute;
    top: 20%;
    right: 15%;
    font-size: 3.5rem;
    opacity: 0.3;
    animation: float 8s ease-in-out infinite reverse;
}

.login-screen .bg-emoji-1 {
    content: "✨";
    position: absolute;
    bottom: 20%;
    left: 20%;
    font-size: 2.5rem;
    opacity: 0.3;
    animation: float 5s ease-in-out infinite 1s;
}

.login-screen .bg-emoji-2 {
    content: "🌴";
    position: absolute;
    bottom: 10%;
    right: 10%;
    font-size: 3rem;
    opacity: 0.3;
    animation: float 7s ease-in-out infinite 2s;
}

.login-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: cardEnter 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    position: relative;
    z-index: 10;
}

.login-card.login-card-exit {
    animation: cardExit 0.5s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards;
}

.login-logo {
    font-size: 4.5rem;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
    display: inline-block;
}

.login-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    font-weight: 500;
}

.login-step {
    transition: all 0.3s ease;
    opacity: 1;
    visibility: visible;
}

.login-step.hidden-step {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    pointer-events: none;
    transform: scale(0.95);
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    background: #ffffff;
    color: #333333;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 1.1rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.google-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    background: #f8fafc;
}

.google-btn:active {
    transform: translateY(0);
}

.google-btn svg {
    width: 24px;
    height: 24px;
}

.login-hint {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 1rem;
    display: block;
}

.login-welcome-user {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.login-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(236, 72, 153, 0.5);
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.3);
}

.login-welcome-user p {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.login-name-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.login-name-input:focus {
    outline: none;
    border-color: #ec4899;
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.3);
    background: rgba(0, 0, 0, 0.3);
}

.login-name-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.login-continue-btn {
    width: 100%;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 1.1rem;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
}

.login-continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.5);
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    animation: fadeIn 0.3s ease;
}

.login-loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: #ec4899;
    animation: spin 1s ease-in-out infinite;
    margin: 20px auto;
}

.login-footer {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px 4px 4px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.user-badge img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.user-badge .user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.logout-btn {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: none;
    border-radius: 12px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #f87171;
}

.hidden {
    display: none !important;
}

/* Animations */
@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes cardEnter {
    0% { transform: scale(0.9) translateY(20px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes cardExit {
    0% { transform: scale(1) translateY(0); opacity: 1; }
    100% { transform: scale(1.1) translateY(-20px); opacity: 0; }
}

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

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

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Responsive */
@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.5rem;
        width: 85%;
    }
    
    .login-title {
        font-size: 2rem;
    }
    
    .login-logo {
        font-size: 3.5rem;
    }
}
