/* Auth Modal Styles */
.auth-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.auth-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

.modal-content {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 2rem;
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #F3F4F6;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1F2937;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #9CA3AF;
    cursor: pointer;
    transition: all 0.3s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:hover {
    background: #F3F4F6;
    color: #1F2937;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #4B5563;
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
    background: #FFFFFF;
}

.form-group input:focus {
    outline: none;
    border-color: #7C3AED;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.form-group.form-check {
    display: flex;
    align-items: center;
}

.form-group.form-check label {
    margin-bottom: 0;
    margin-left: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.form-group.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.btn-submit {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, #7C3AED 0%, #8B5CF6 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 1rem;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.3);
}

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

.form-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: #6B7280;
    font-size: 0.95rem;
}

.form-footer a {
    color: #7C3AED;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s;
}

.form-footer a:hover {
    color: #6B21A8;
    text-decoration: underline;
}

.form-help {
    color: #6B7280;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.error-message {
    background: #FEE2E2;
    color: #DC2626;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: none;
}

.error-message.active {
    display: block;
}

.success-message {
    background: #D1FAE5;
    color: #065F46;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: none;
}

.success-message.active {
    display: block;
}

/* Loading state */
.btn-submit.loading {
    position: relative;
    color: transparent;
}

.btn-submit.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

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

/* Mobile responsive */
@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .form-group input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .modal-content {
        background: #1F2937;
        color: #F3F4F6;
    }
    
    .modal-header {
        border-bottom-color: #374151;
    }
    
    .modal-header h2 {
        color: #F3F4F6;
    }
    
    .form-group label {
        color: #D1D5DB;
    }
    
    .form-group input {
        background: #374151;
        border-color: #4B5563;
        color: #F3F4F6;
    }
    
    .form-group input:focus {
        border-color: #8B5CF6;
        box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
    }
    
    .form-footer {
        color: #9CA3AF;
    }
    
    .close-btn:hover {
        background: #374151;
        color: #F3F4F6;
    }
}

/* Alternative login methods */
.divider-or {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.divider-or::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #E5E7EB;
}

.divider-or span {
    background: white;
    padding: 0 1rem;
    position: relative;
    color: #9CA3AF;
    font-size: 0.875rem;
}

.telegram-login-btn {
    width: 100%;
    padding: 0.9rem;
    background: #0088cc;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.telegram-login-btn:hover {
    background: #0077b5;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 136, 204, 0.3);
}

.telegram-login-btn svg {
    width: 20px;
    height: 20px;
}