html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    touch-action: pan-y;
}

body {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background-color: #2b2b2b;
    color: #fff;
    font-family: Arial, sans-serif;
    min-height: 100vh;
}

.login-side {
    width: 100%;
    max-width: 340px;
    padding: 20px;
    margin: 0 auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    overflow-y: visible;
}

.container {
    width: 100%;
    max-width: 410px;
    min-width: 312px;
    padding: 20px 0;
    margin: 0 auto;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: none;
    box-sizing: border-box;
    text-align: center;
    overflow-y: visible;
    flex-shrink: 0;
}

.container.loaded {
    opacity: 1;
    transform: scale(1);
    display: block;
}

#loginForm {
    width: 100%;
    max-width: 410px;
    margin: 0 auto;
}

input[type="email"],
input[type="password"] {
    width: 100%;
    min-width: 0;
    padding: 12px;
    margin-bottom: 1rem;
    border: 1px solid #444;
    border-radius: 6px;
    background-color: #2b2b2b;
    color: #fff;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
    flex-shrink: 0;
}

input:focus {
    border-color: #0066ff;
    outline: none;
}

button[type="submit"] {
    width: 100%;
    min-width: 0;
    padding: 12px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(45deg, #0066ff, #0052cc);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    margin: 0.5rem 0;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.logo {
    width: 80px;
    height: auto;
    margin: 0 auto 1.5rem;
    display: block;
}

h2, h4 {
    text-align: center;
    margin: 0;
}

h2 { 
    margin-bottom: 0.5rem; 
}

h4 { 
    color: #888; 
    font-weight: normal; 
    margin-bottom: 1.5rem; 
}

.turnstile-warning {
    background-color: #ff8c00;
    color: #fff;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    display: none;
    margin: 10px auto;
    width: 100%;
    max-width: 410px;
    box-sizing: border-box;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

.turnstile-warning.show {
    display: block;
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
    width: 100%;
    max-width: 410px;
    margin-left: auto;
    margin-right: auto;
}

.auth-button {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
    text-decoration: none;
    box-sizing: border-box;
}

.discord-button {
    background: #5865F2;
    color: white;
    border: none;
}

.discord-button:hover {
    background: #4752C4;
    transform: translateY(-1px);
}

.google-button {
    background: #fff;
    color: #757575;
    border: 1px solid #ddd;
}

.google-button:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.auth-button img,
.github-button img {
    width: 20px !important;
    height: 20px !important;
    margin-right: 12px !important;
    filter: none;
}

.github-button {
    background: #24292f;
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(36,41,47,0.08);
}
.github-button:hover, .github-button:focus {
    background: #1b1f23;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(36,41,47,0.12);
}

.separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1rem auto;
    color: #999;
    font-size: 0.9rem;
    width: 100%;
    max-width: 410px;
}

.separator::before,
.separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #444;
    margin: 0 0.5rem;
}

.auth-links {
    margin-top: 1.5rem;
    text-align: center;
    width: 100%;
    max-width: 410px;
    margin-left: auto;
    margin-right: auto;
}

.auth-links a {
    color: #66d9ff;
    text-decoration: none;
    transition: color 0.3s;
}

.auth-links a:hover {
    color: #99e6ff;
}

.loading-container {
    text-align: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 1;
    transition: opacity 0.3s ease;
    z-index: 1000;
    background: rgba(43, 43, 43, 0.95);
    padding: 2rem;
    border-radius: 12px;
    width: 100%;
    max-width: 410px;
    min-width: 312px;
    box-sizing: border-box;
    flex-shrink: 0;
}


.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.cf-turnstile {
    display: flex;
    justify-content: center;
    margin: 0.5rem auto;
    width: 100%;
    max-width: 410px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
    body {
        min-height: 100%;
        height: auto;
    }

    .login-side {
        padding: 20px 15px;
        min-height: 100%;
        height: auto;
    }

    .container,
    .loading-container,
    #loginForm,
    .auth-buttons,
    .turnstile-warning,
    .separator,
    .auth-links,
    .cf-turnstile {
        width: calc(100% - 30px);
        max-width: 410px;
        min-width: 312px;
        margin-left: auto;
        margin-right: auto;
    }

    .container {
        padding: 10px 0;
    }

    .logo {
        width: 70px;
        margin: 1rem auto 1.5rem;
    }

    .github-button {
        width: 100%;
        justify-content: center;
        font-size: 0.95rem;
        padding: 10px;
    }
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
}