/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: white;
    overflow-x: hidden;
}

/* Container */
.container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.auth-wrapper {
    width: 100%;
    max-width: 400px;
    background: rgba(30, 30, 50, 0.9);
    border-radius: 20px;
    padding: 40px 30px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo Section */
.logo-section {
    text-align: center;
    margin-bottom: 40px;
}

.main-logo {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(45deg, #00ff88, #ffd700, #ff6b6b);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.tagline {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 300;
}

/* Auth Container */
.auth-container {
    margin-bottom: 30px;
}

.auth-form {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-form h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    margin-bottom: 30px;
    text-align: center;
}

/* Input Groups */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input-group input:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

.input-group input:valid {
    border-color: rgba(0, 255, 136, 0.5);
}

.input-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    opacity: 0.7;
}

/* Auth Button */
.auth-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    background: linear-gradient(45deg, #00ff88, #00cc6a);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 255, 136, 0.3);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Button Loader */
.btn-loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Auth Switch */
.auth-switch {
    text-align: center;
}

.auth-switch p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.auth-switch a {
    color: #00ff88;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-switch a:hover {
    color: #00cc6a;
    text-decoration: underline;
}

/* Alternative Login */
.alternative-login {
    text-align: center;
}

.divider {
    position: relative;
    margin: 20px 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.divider span {
    background: rgba(30, 30, 50, 0.9);
    padding: 0 15px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.telegram-btn {
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid #0088cc;
    border-radius: 12px;
    background: linear-gradient(45deg, #0088cc, #0066aa);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
}

.telegram-btn:hover {
    background: linear-gradient(45deg, #0099dd, #0077bb);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
}

.telegram-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Message Container */
.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.message {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 10px;
    font-weight: 600;
    animation: slideInRight 0.3s ease-out;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.message.success {
    background: linear-gradient(45deg, #00ff88, #00cc6a);
    color: white;
}

.message.error {
    background: linear-gradient(45deg, #ff4757, #ff3742);
    color: white;
}

.message.info {
    background: linear-gradient(45deg, #3742fa, #2f3542);
    color: white;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .auth-wrapper {
        padding: 30px 20px;
    }
    
    .main-logo {
        font-size: 2.5rem;
    }
    
    .auth-form h2 {
        font-size: 1.5rem;
    }
    
    .input-group input {
        padding: 12px 45px 12px 15px;
    }
    
    .auth-btn, .telegram-btn {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .auth-wrapper {
        padding: 25px 15px;
    }
    
    .main-logo {
        font-size: 2rem;
    }
    
    .message-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .message {
        text-align: center;
    }
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading .btn-loader {
    display: inline-block !important;
}

/* Form Validation */
.input-group.error input {
    border-color: #ff4757;
    box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.2);
}

.input-group.success input {
    border-color: #00ff88;
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.2);
}