body {
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    font-family: 'Arial', sans-serif;
    overflow: auto;
}

/* Galaxy Background */
.galaxy-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    opacity: 0;
    animation: twinkle 3s infinite ease-in-out;
}

@keyframes twinkle {
    0% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.5); }
}

.nebula-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 70%, rgba(106, 13, 173, 0.2), transparent 50%),
                radial-gradient(circle at 70% 20%, rgba(230, 230, 250, 0.1), transparent 50%);
    opacity: 0.5;
}

/* Authentication Modal */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.auth-content {
    background: rgba(26, 42, 68, 0.95);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(106, 13, 173, 0.5);
    width: 100%;
    max-width: 400px;
    text-align: center;
    animation: modalFadeIn 1s ease-out forwards;
    min-height: 450px; /* Increased to ensure space for all elements */
}

@keyframes modalFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(50px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.auth-content h2 {
    color: #6A0DAD;
    margin-bottom: 20px;
    font-size: 1.5em;
    animation: glowText 2s infinite ease-in-out;
}

@keyframes glowText {
    0%, 100% { text-shadow: 0 0 5px #6A0DAD; }
    50% { text-shadow: 0 0 15px #6A0DAD, 0 0 25px #6A0DAD; }
}

.form-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-content label {
    display: block;
    text-align: left;
    color: #fffafa;
    margin-bottom: 5px;
    font-size: 1em;
    opacity: 0;
    animation: slideIn 0.5s ease-out forwards;
    animation-delay: 0.3s;
}

.auth-content label:nth-child(3) {
    animation-delay: 0.5s;
}

@keyframes slideIn {
    0% { opacity: 0; transform: translateX(-20px); }
    100% { opacity: 1; transform: translateX(0); }
}

.auth-content input {
    width: 100%;
    padding: 10px;
    margin-bottom: 0;
    border: 2px solid #6A0DAD;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: #fffafa;
    font-size: 1em;
    outline: none;
    box-sizing: border-box;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    opacity: 0;
    animation: slideIn 0.5s ease-out forwards;
    animation-delay: 0.7s;
}

.auth-content input:nth-child(2) {
    animation-delay: 0.9s;
}

.auth-content input:focus {
    border-color: #E6E6FA;
    box-shadow: 0 0 15px #6A0DAD;
}

.auth-content input:hover {
    box-shadow: 0 0 10px rgba(106, 13, 173, 0.5);
}

.key-input-wrapper {
    position: relative;
}

.toggle-key-visibility {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #fffafa;
    font-size: 1.2em;
    transition: transform 0.3s ease;
    opacity: 0;
    animation: slideIn 0.5s ease-out forwards;
    animation-delay: 1.1s;
}

.toggle-key-visibility:hover {
    transform: translateY(-50%) scale(1.2);
}

.auth-content .auth-button {
    /* Simplified styling to ensure visibility */
    display: block; /* Ensure the button is a block element */
    background: #6A0DAD;
    color: #fffafa;
    padding: 12px;
    width: 100%;
    border: none;
    border-radius: 5px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    /* Reintroduce animation with adjustments */
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
    animation-delay: 0.5s;
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.auth-content .auth-button:hover {
    background: #1A2A44;
    transform: scale(1.1);
    box-shadow: 0 0 20px #6A0DAD;
}

.error-message {
    color: #FF4040;
    margin-top: 10px;
    font-size: 0.9em;
    min-height: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.error-message.show {
    opacity: 1;
}