* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.login-container {
    width: 100%;
    max-width: 450px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-box {
    background: white;
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
    transform-origin: center;
}

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

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite, topBarSlide 0.8s ease-out;
}

@keyframes topBarSlide {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80px;
    animation: logoFadeIn 0.8s ease-out 0.2s both;
}

@keyframes logoFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.login-logo img {
    max-width: 200px;
    max-height: 80px;
    object-fit: contain;
    display: block;
}

.logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 15px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
}

.logo-icon {
    font-size: 32px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
}

.login-header h1 {
    color: #1f2937;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    animation: slideInLeft 0.6s ease-out 0.4s both;
}

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

.login-header p {
    color: #6b7280;
    font-size: 15px;
    font-weight: 400;
    animation: slideInRight 0.6s ease-out 0.5s both;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.login-form {
    margin-top: 30px;
}

.error-message {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid #dc2626;
    font-size: 14px;
    font-weight: 500;
    animation: shake 0.5s ease-in-out, fadeIn 0.3s ease-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.error-icon {
    font-size: 18px;
}

.form-group {
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease-out both;
}

.form-group:nth-child(1) {
    animation-delay: 0.6s;
}

.form-group:nth-child(2) {
    animation-delay: 0.7s;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 600;
    font-size: 14px;
}

.label-icon {
    font-size: 16px;
    opacity: 0.7;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #f9fafb;
    color: #1f2937;
    animation: inputSlideIn 0.5s ease-out both;
}

.form-group:nth-child(1) input {
    animation-delay: 0.6s;
}

.form-group:nth-child(2) input {
    animation-delay: 0.7s;
}

@keyframes inputSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
    animation: inputFocus 0.3s ease-out;
}

@keyframes inputFocus {
    0% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-2px) scale(1.01);
    }
    100% {
        transform: translateY(-2px) scale(1);
    }
}

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

.login-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    animation: buttonFadeIn 0.6s ease-out 0.8s both;
    position: relative;
    overflow: hidden;
}

@keyframes buttonFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.login-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.login-button:hover::before {
    width: 300px;
    height: 300px;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.login-button:active {
    transform: translateY(0);
}

.button-text {
    font-size: 16px;
}

.button-icon {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.login-button:hover .button-icon {
    transform: translateX(4px);
}

.login-footer {
    margin-top: 30px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.copyright {
    font-size: 13px;
    color: #6b7280;
    font-weight: 400;
    animation: fadeInUp 0.6s ease-out 1s both;
}

.copyright a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.copyright a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.copyright a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.copyright a:hover::after {
    width: 100%;
}

/* Animated Background Elements */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle ease-in-out infinite;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

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

.planet {
    position: fixed;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #4a90e2, #2c5aa0);
    box-shadow: 
        0 0 50px rgba(74, 144, 226, 0.6),
        inset -20px -20px 40px rgba(0, 0, 0, 0.5),
        inset 10px 10px 20px rgba(255, 255, 255, 0.2);
    top: 10%;
    right: 10%;
    animation: float 20s ease-in-out infinite, rotate 60s linear infinite;
    z-index: 1;
}

.planet::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
}

.planet-orbit {
    position: fixed;
    width: 200px;
    height: 200px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    top: 5%;
    right: 5%;
    animation: rotate 120s linear infinite;
    z-index: 0;
}

.planet-orbit::before {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    background: radial-gradient(circle, #ffd700, #ff8c00);
    border-radius: 50%;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    animation: moonGlow 2s ease-in-out infinite alternate;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
    }
    25% {
        transform: translateY(-20px) translateX(10px);
    }
    50% {
        transform: translateY(10px) translateX(-10px);
    }
    75% {
        transform: translateY(-10px) translateX(20px);
    }
}

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

@keyframes shimmer {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes moonGlow {
    from {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    }
    to {
        box-shadow: 0 0 30px rgba(255, 215, 0, 1);
    }
}

/* Ensure login box stays above background elements */
.login-container {
    position: relative;
    z-index: 10;
}

.default-credentials {
    font-size: 12px;
    color: #6b7280;
    font-weight: 400;
    background: #f9fafb;
    padding: 10px 15px;
    border-radius: 8px;
    display: inline-block;
}

/* Responsive Design */
@media (max-width: 480px) {
    .login-box {
        padding: 40px 30px;
        border-radius: 16px;
    }
    
    .login-header h1 {
        font-size: 28px;
    }
    
    .login-logo img {
        max-width: 150px;
        max-height: 60px;
    }
    
    .logo-fallback {
        padding: 12px 20px;
    }
    
    .logo-icon {
        font-size: 24px;
    }
    
    .logo-text {
        font-size: 20px;
    }
}

/* Loading state */
.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.login-button:disabled:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}
